mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
chore: Use "contain_exactly" in some tests (#4243)
This commit is contained in:
@@ -109,8 +109,8 @@ RSpec.describe 'Api::V1::Accounts::BulkActionsController', type: :request do
|
|||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(:success)
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(Conversation.first.label_list).to eq(%w[support priority_customer])
|
expect(Conversation.first.label_list).to contain_exactly('support', 'priority_customer')
|
||||||
expect(Conversation.second.label_list).to eq(%w[support priority_customer])
|
expect(Conversation.second.label_list).to contain_exactly('support', 'priority_customer')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -126,8 +126,8 @@ RSpec.describe 'Api::V1::Accounts::BulkActionsController', type: :request do
|
|||||||
|
|
||||||
params = { type: 'Conversation', ids: Conversation.first(3).pluck(:display_id), labels: { remove: %w[support] } }
|
params = { type: 'Conversation', ids: Conversation.first(3).pluck(:display_id), labels: { remove: %w[support] } }
|
||||||
|
|
||||||
expect(Conversation.first.label_list).to eq(%w[support priority_customer])
|
expect(Conversation.first.label_list).to contain_exactly('support', 'priority_customer')
|
||||||
expect(Conversation.second.label_list).to eq(%w[support priority_customer])
|
expect(Conversation.second.label_list).to contain_exactly('support', 'priority_customer')
|
||||||
|
|
||||||
perform_enqueued_jobs do
|
perform_enqueued_jobs do
|
||||||
post "/api/v1/accounts/#{account.id}/bulk_actions",
|
post "/api/v1/accounts/#{account.id}/bulk_actions",
|
||||||
@@ -137,8 +137,8 @@ RSpec.describe 'Api::V1::Accounts::BulkActionsController', type: :request do
|
|||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(:success)
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(Conversation.first.label_list).to eq(['priority_customer'])
|
expect(Conversation.first.label_list).to contain_exactly('priority_customer')
|
||||||
expect(Conversation.second.label_list).to eq(['priority_customer'])
|
expect(Conversation.second.label_list).to contain_exactly('priority_customer')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ describe AutomationRuleListener do
|
|||||||
listener.conversation_status_changed(event)
|
listener.conversation_status_changed(event)
|
||||||
|
|
||||||
conversation.reload
|
conversation.reload
|
||||||
expect(conversation.labels.pluck(:name)).to eq(%w[support priority_customer])
|
expect(conversation.labels.pluck(:name)).to contain_exactly('support', 'priority_customer')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'triggers automation rule to assign best agents' do
|
it 'triggers automation rule to assign best agents' do
|
||||||
@@ -177,7 +177,7 @@ describe AutomationRuleListener do
|
|||||||
listener.conversation_updated(event)
|
listener.conversation_updated(event)
|
||||||
|
|
||||||
conversation.reload
|
conversation.reload
|
||||||
expect(conversation.labels.pluck(:name)).to eq(%w[support priority_customer])
|
expect(conversation.labels.pluck(:name)).to contain_exactly('support', 'priority_customer')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'triggers automation rule to assign best agents' do
|
it 'triggers automation rule to assign best agents' do
|
||||||
@@ -268,7 +268,7 @@ describe AutomationRuleListener do
|
|||||||
listener.message_created(event)
|
listener.message_created(event)
|
||||||
|
|
||||||
conversation.reload
|
conversation.reload
|
||||||
expect(conversation.labels.pluck(:name)).to eq(%w[support priority_customer])
|
expect(conversation.labels.pluck(:name)).to contain_exactly('support', 'priority_customer')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'triggers automation rule to assign best agent' do
|
it 'triggers automation rule to assign best agent' do
|
||||||
|
|||||||
Reference in New Issue
Block a user