chore: Use "contain_exactly" in some tests (#4243)

This commit is contained in:
Jordan Brough 2022-03-24 02:20:04 -06:00 committed by GitHub
parent 7577c9c888
commit 14c53b8b54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View file

@ -109,8 +109,8 @@ RSpec.describe 'Api::V1::Accounts::BulkActionsController', type: :request do
expect(response).to have_http_status(:success)
end
expect(Conversation.first.label_list).to eq(%w[support priority_customer])
expect(Conversation.second.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 contain_exactly('support', 'priority_customer')
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] } }
expect(Conversation.first.label_list).to eq(%w[support priority_customer])
expect(Conversation.second.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 contain_exactly('support', 'priority_customer')
perform_enqueued_jobs do
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)
end
expect(Conversation.first.label_list).to eq(['priority_customer'])
expect(Conversation.second.label_list).to eq(['priority_customer'])
expect(Conversation.first.label_list).to contain_exactly('priority_customer')
expect(Conversation.second.label_list).to contain_exactly('priority_customer')
end
end
end

View file

@ -77,7 +77,7 @@ describe AutomationRuleListener do
listener.conversation_status_changed(event)
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
it 'triggers automation rule to assign best agents' do
@ -177,7 +177,7 @@ describe AutomationRuleListener do
listener.conversation_updated(event)
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
it 'triggers automation rule to assign best agents' do
@ -268,7 +268,7 @@ describe AutomationRuleListener do
listener.message_created(event)
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
it 'triggers automation rule to assign best agent' do