diff options
Diffstat (limited to 'spec/lib/gitlab/setup_helper/workhorse_spec.rb')
-rw-r--r-- | spec/lib/gitlab/setup_helper/workhorse_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/lib/gitlab/setup_helper/workhorse_spec.rb b/spec/lib/gitlab/setup_helper/workhorse_spec.rb index aa9b4595799..18cb266bf4e 100644 --- a/spec/lib/gitlab/setup_helper/workhorse_spec.rb +++ b/spec/lib/gitlab/setup_helper/workhorse_spec.rb @@ -22,4 +22,28 @@ RSpec.describe Gitlab::SetupHelper::Workhorse do end end end + + describe '.redis_url' do + it 'matches the SharedState URL' do + expect(Gitlab::Redis::SharedState).to receive(:url).and_return('foo') + + expect(described_class.redis_url).to eq('foo') + end + end + + describe '.redis_db' do + subject { described_class.redis_db } + + it 'matches the SharedState DB' do + expect(Gitlab::Redis::SharedState).to receive(:params).and_return(db: 1) + + is_expected.to eq(1) + end + + it 'defaults to 0 if unspecified' do + expect(Gitlab::Redis::SharedState).to receive(:params).and_return({}) + + is_expected.to eq(0) + end + end end |