diff options
author | Brett Walker <bwalker@gitlab.com> | 2017-12-05 14:56:22 +0100 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2017-12-05 14:56:22 +0100 |
commit | 2f2d85b4697c588c4c8b81d5f8c34433857f3a91 (patch) | |
tree | 7c2b1a520db9532b51b3cb6b122be426c8bb064d | |
parent | 848d196d1bf7a9a5626082a59f7622abbc21254a (diff) | |
download | gitlab-ce-bw-replication-slots-supported.tar.gz |
added specsbw-replication-slots-supported
-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 |