fix: spec for conversation.updated
This commit is contained in:
parent
e6750d468d
commit
6c1538f96e
1 changed files with 16 additions and 0 deletions
|
@ -128,4 +128,20 @@ describe ActionCableListener do
|
||||||
listener.contact_deleted(event)
|
listener.contact_deleted(event)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#conversation_updated' do
|
||||||
|
let(:event_name) { :'conversation.updated' }
|
||||||
|
let!(:event) { Events::Base.new(event_name, Time.zone.now, conversation: conversation, user: agent, is_private: false) }
|
||||||
|
|
||||||
|
it 'sends update to inbox members' do
|
||||||
|
expect(conversation.inbox.reload.inbox_members.count).to eq(1)
|
||||||
|
|
||||||
|
expect(ActionCableBroadcastJob).to receive(:perform_later).with(
|
||||||
|
[agent.pubsub_token, admin.pubsub_token, conversation.contact_inbox.pubsub_token],
|
||||||
|
'conversation.updated',
|
||||||
|
conversation.push_event_data.merge(account_id: account.id)
|
||||||
|
)
|
||||||
|
listener.conversation_updated(event)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue