Skip to content

Commit

Permalink
chore: Fix flaky spec relying on unguaranteed order (#8956)
Browse files Browse the repository at this point in the history
  • Loading branch information
sojan-official committed Feb 16, 2024
1 parent fe744ab commit 94892e7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions spec/controllers/api/v1/accounts/contacts_controller_spec.rb
Expand Up @@ -50,8 +50,11 @@

expect(response).to have_http_status(:success)
response_body = response.parsed_body
expect(response_body['payload'].first['email']).to eq(contact.email)
expect(response_body['payload'].first['contact_inboxes'].blank?).to be(true)

contact_emails = response_body['payload'].pluck('email')
contact_inboxes = response_body['payload'].pluck('contact_inboxes').flatten.compact
expect(contact_emails).to include(contact.email)
expect(contact_inboxes).to eq([])
end

it 'returns all contacts with company name desc order' do
Expand Down

0 comments on commit 94892e7

Please sign in to comment.