diff options
Diffstat (limited to 'spec/lib/gitaly/server_spec.rb')
-rw-r--r-- | spec/lib/gitaly/server_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/lib/gitaly/server_spec.rb b/spec/lib/gitaly/server_spec.rb index 5142f705251..390855b30ad 100644 --- a/spec/lib/gitaly/server_spec.rb +++ b/spec/lib/gitaly/server_spec.rb @@ -20,6 +20,7 @@ describe Gitaly::Server do it { is_expected.to respond_to(:git_binary_version) } it { is_expected.to respond_to(:up_to_date?) } it { is_expected.to respond_to(:address) } + it { is_expected.to respond_to(:replication_factor) } describe 'readable?' do context 'when the storage is readable' do @@ -134,4 +135,22 @@ describe Gitaly::Server do end end end + + describe 'replication_factor' do + context 'when examining for a given server' do + let(:storage_status) { double('storage_status', storage_name: 'default') } + + before do + response = double('response', storage_statuses: [storage_status]) + allow_next_instance_of(Gitlab::GitalyClient::ServerService) do |instance| + allow(instance).to receive(:info).and_return(response) + end + end + + it do + allow(storage_status).to receive(:replication_factor).and_return(2) + expect(server.replication_factor).to eq(2) + end + end + end end |