diff options
author | Brett Walker <brett@digitalmoksha.com> | 2017-12-05 16:43:47 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-12-05 16:43:47 +0000 |
commit | 02d97d46216b60568fb248f9aeb779528abd8e9c (patch) | |
tree | e8655dbc12e78e2f20e394564eb182b5eeead88f /spec/lib | |
parent | 784edd654b8ef36535d3c1773b7a43d8f3c19b23 (diff) | |
download | gitlab-ce-02d97d46216b60568fb248f9aeb779528abd8e9c.tar.gz |
add Gitlab::Database.replication_slots_supported?
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/database_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/gitlab/database_spec.rb b/spec/lib/gitlab/database_spec.rb index fcddfad3f9f..a5657b81952 100644 --- a/spec/lib/gitlab/database_spec.rb +++ b/spec/lib/gitlab/database_spec.rb @@ -73,6 +73,28 @@ describe Gitlab::Database do end end + describe '.replication_slots_supported?' do + it 'returns false when using MySQL' do + allow(described_class).to receive(:postgresql?).and_return(false) + + expect(described_class.replication_slots_supported?).to eq(false) + end + + it 'returns false when using PostgreSQL 9.3' do + allow(described_class).to receive(:postgresql?).and_return(true) + allow(described_class).to receive(:version).and_return('9.3.1') + + expect(described_class.replication_slots_supported?).to eq(false) + end + + it 'returns true when using PostgreSQL 9.4.0 or newer' do + allow(described_class).to receive(:postgresql?).and_return(true) + allow(described_class).to receive(:version).and_return('9.4.0') + + expect(described_class.replication_slots_supported?).to eq(true) + end + end + describe '.nulls_last_order' do context 'when using PostgreSQL' do before do |