diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-04-28 17:47:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-28 17:47:34 +0200 |
commit | 3917353645b91dae04f7d9b81162fead6f73072a (patch) | |
tree | 202cbf93dfa378c26a291900ea65ec088ee5b5cc /spec/services/fan_out_on_write_service_spec.rb | |
parent | 9bf04db23acf10e05ffdf7def06c246081f8f065 (diff) |
Fix single Redis connection being used across all threads (#18135)
* Fix single Redis connection being used across all Sidekiq threads * Fix tests
Diffstat (limited to 'spec/services/fan_out_on_write_service_spec.rb')
-rw-r--r-- | spec/services/fan_out_on_write_service_spec.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/services/fan_out_on_write_service_spec.rb b/spec/services/fan_out_on_write_service_spec.rb index aaf179ce5..59e15d230 100644 --- a/spec/services/fan_out_on_write_service_spec.rb +++ b/spec/services/fan_out_on_write_service_spec.rb @@ -18,7 +18,7 @@ RSpec.describe FanOutOnWriteService, type: :service do ProcessMentionsService.new.call(status) ProcessHashtagsService.new.call(status) - allow(Redis.current).to receive(:publish) + allow(redis).to receive(:publish) subject.call(status) end @@ -40,13 +40,13 @@ RSpec.describe FanOutOnWriteService, type: :service do end it 'is broadcast to the hashtag stream' do - expect(Redis.current).to have_received(:publish).with('timeline:hashtag:hoge', anything) - expect(Redis.current).to have_received(:publish).with('timeline:hashtag:hoge:local', anything) + expect(redis).to have_received(:publish).with('timeline:hashtag:hoge', anything) + expect(redis).to have_received(:publish).with('timeline:hashtag:hoge:local', anything) end it 'is broadcast to the public stream' do - expect(Redis.current).to have_received(:publish).with('timeline:public', anything) - expect(Redis.current).to have_received(:publish).with('timeline:public:local', anything) + expect(redis).to have_received(:publish).with('timeline:public', anything) + expect(redis).to have_received(:publish).with('timeline:public:local', anything) end end @@ -66,8 +66,8 @@ RSpec.describe FanOutOnWriteService, type: :service do end it 'is not broadcast publicly' do - expect(Redis.current).to_not have_received(:publish).with('timeline:hashtag:hoge', anything) - expect(Redis.current).to_not have_received(:publish).with('timeline:public', anything) + expect(redis).to_not have_received(:publish).with('timeline:hashtag:hoge', anything) + expect(redis).to_not have_received(:publish).with('timeline:public', anything) end end @@ -84,8 +84,8 @@ RSpec.describe FanOutOnWriteService, type: :service do end it 'is not broadcast publicly' do - expect(Redis.current).to_not have_received(:publish).with('timeline:hashtag:hoge', anything) - expect(Redis.current).to_not have_received(:publish).with('timeline:public', anything) + expect(redis).to_not have_received(:publish).with('timeline:hashtag:hoge', anything) + expect(redis).to_not have_received(:publish).with('timeline:public', anything) end end @@ -105,8 +105,8 @@ RSpec.describe FanOutOnWriteService, type: :service do end it 'is not broadcast publicly' do - expect(Redis.current).to_not have_received(:publish).with('timeline:hashtag:hoge', anything) - expect(Redis.current).to_not have_received(:publish).with('timeline:public', anything) + expect(redis).to_not have_received(:publish).with('timeline:hashtag:hoge', anything) + expect(redis).to_not have_received(:publish).with('timeline:public', anything) end end end |