0
0
Fork 0

Worker specs coverage increase (#32541)

This commit is contained in:
Matt Jankowski 2024-10-23 03:50:20 -04:00 committed by GitHub
parent bd0c826a3d
commit d1b20ea8f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 186 additions and 15 deletions

View file

@ -6,8 +6,30 @@ RSpec.describe PushConversationWorker do
let(:worker) { described_class.new }
describe 'perform' do
it 'runs without error for missing record' do
expect { worker.perform(nil) }.to_not raise_error
context 'with missing values' do
it 'runs without error' do
expect { worker.perform(nil) }
.to_not raise_error
end
end
context 'with valid records' do
let(:account_conversation) { Fabricate :account_conversation }
before { allow(redis).to receive(:publish) }
it 'pushes message to timeline' do
expect { worker.perform(account_conversation.id) }
.to_not raise_error
expect(redis)
.to have_received(:publish)
.with(redis_key, anything)
end
def redis_key
"timeline:direct:#{account_conversation.account_id}"
end
end
end
end