Skip to content

Commit

Permalink
chore: Use "contain_exactly" in some tests (#4243)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-brough committed Mar 24, 2022
1 parent 7577c9c commit 14c53b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions spec/controllers/api/v1/accounts/bulk_actions_controller_spec.rb
Expand Up @@ -109,8 +109,8 @@
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
Expand All @@ -126,8 +126,8 @@

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",
Expand All @@ -137,8 +137,8 @@
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
Expand Down
6 changes: 3 additions & 3 deletions spec/listeners/automation_rule_listener_spec.rb
Expand Up @@ -77,7 +77,7 @@
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
Expand Down Expand Up @@ -177,7 +177,7 @@
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
Expand Down Expand Up @@ -268,7 +268,7 @@
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
Expand Down

0 comments on commit 14c53b8

Please sign in to comment.