chore: Fix test failure in action_cable_listener_spec.rb due to ordering (#4357)
This commit is contained in:
@@ -24,7 +24,9 @@ describe ActionCableListener do
|
|||||||
expect(conversation.inbox.reload.inbox_members.count).to eq(1)
|
expect(conversation.inbox.reload.inbox_members.count).to eq(1)
|
||||||
|
|
||||||
expect(ActionCableBroadcastJob).to receive(:perform_later).with(
|
expect(ActionCableBroadcastJob).to receive(:perform_later).with(
|
||||||
[agent.pubsub_token, admin.pubsub_token, conversation.contact_inbox.pubsub_token],
|
a_collection_containing_exactly(
|
||||||
|
agent.pubsub_token, admin.pubsub_token, conversation.contact_inbox.pubsub_token
|
||||||
|
),
|
||||||
'message.created',
|
'message.created',
|
||||||
message.push_event_data.merge(account_id: account.id)
|
message.push_event_data.merge(account_id: account.id)
|
||||||
)
|
)
|
||||||
@@ -40,7 +42,9 @@ describe ActionCableListener do
|
|||||||
verified_contact_inbox = create(:contact_inbox, contact: conversation.contact, inbox: inbox, hmac_verified: true)
|
verified_contact_inbox = create(:contact_inbox, contact: conversation.contact, inbox: inbox, hmac_verified: true)
|
||||||
|
|
||||||
expect(ActionCableBroadcastJob).to receive(:perform_later).with(
|
expect(ActionCableBroadcastJob).to receive(:perform_later).with(
|
||||||
[agent.pubsub_token, admin.pubsub_token, conversation.contact_inbox.pubsub_token, verified_contact_inbox.pubsub_token],
|
a_collection_containing_exactly(
|
||||||
|
agent.pubsub_token, admin.pubsub_token, conversation.contact_inbox.pubsub_token, verified_contact_inbox.pubsub_token
|
||||||
|
),
|
||||||
'message.created',
|
'message.created',
|
||||||
message.push_event_data.merge(account_id: account.id)
|
message.push_event_data.merge(account_id: account.id)
|
||||||
)
|
)
|
||||||
@@ -56,7 +60,9 @@ describe ActionCableListener do
|
|||||||
# HACK: to reload conversation inbox members
|
# HACK: to reload conversation inbox members
|
||||||
expect(conversation.inbox.reload.inbox_members.count).to eq(1)
|
expect(conversation.inbox.reload.inbox_members.count).to eq(1)
|
||||||
expect(ActionCableBroadcastJob).to receive(:perform_later).with(
|
expect(ActionCableBroadcastJob).to receive(:perform_later).with(
|
||||||
[admin.pubsub_token, conversation.contact.pubsub_token],
|
a_collection_containing_exactly(
|
||||||
|
admin.pubsub_token, conversation.contact.pubsub_token
|
||||||
|
),
|
||||||
'conversation.typing_on', conversation: conversation.push_event_data,
|
'conversation.typing_on', conversation: conversation.push_event_data,
|
||||||
user: agent.push_event_data,
|
user: agent.push_event_data,
|
||||||
account_id: account.id,
|
account_id: account.id,
|
||||||
@@ -74,7 +80,9 @@ describe ActionCableListener do
|
|||||||
# HACK: to reload conversation inbox members
|
# HACK: to reload conversation inbox members
|
||||||
expect(conversation.inbox.reload.inbox_members.count).to eq(1)
|
expect(conversation.inbox.reload.inbox_members.count).to eq(1)
|
||||||
expect(ActionCableBroadcastJob).to receive(:perform_later).with(
|
expect(ActionCableBroadcastJob).to receive(:perform_later).with(
|
||||||
[admin.pubsub_token, conversation.contact.pubsub_token],
|
a_collection_containing_exactly(
|
||||||
|
admin.pubsub_token, conversation.contact.pubsub_token
|
||||||
|
),
|
||||||
'conversation.typing_off', conversation: conversation.push_event_data,
|
'conversation.typing_off', conversation: conversation.push_event_data,
|
||||||
user: agent.push_event_data,
|
user: agent.push_event_data,
|
||||||
account_id: account.id,
|
account_id: account.id,
|
||||||
@@ -91,7 +99,9 @@ describe ActionCableListener do
|
|||||||
|
|
||||||
it 'sends message to account admins, inbox agents' do
|
it 'sends message to account admins, inbox agents' do
|
||||||
expect(ActionCableBroadcastJob).to receive(:perform_later).with(
|
expect(ActionCableBroadcastJob).to receive(:perform_later).with(
|
||||||
[agent.pubsub_token, admin.pubsub_token],
|
a_collection_containing_exactly(
|
||||||
|
agent.pubsub_token, admin.pubsub_token
|
||||||
|
),
|
||||||
'contact.deleted',
|
'contact.deleted',
|
||||||
contact.push_event_data.merge(account_id: account.id)
|
contact.push_event_data.merge(account_id: account.id)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user