Decouple tests from unspecified data ordering

These tests have been passing with SQLite, but don't reflect guaranteed
behavior and with PostgreSQL failed intermittently.
This commit is contained in:
Andrew Kvalheim 2020-03-20 06:24:47 -07:00
parent e6f3aa559e
commit a7006a4edd
5 changed files with 26 additions and 27 deletions

View file

@ -21,8 +21,7 @@ describe Api::V1::ConferencesController do
end
it 'returns correct conferences' do
expect(@json[0]['short_title']).to eq('conf_one')
expect(@json[1]['short_title']).to eq('conf_two')
expect(@json.map { |c| c['short_title'] }).to contain_exactly('conf_one', 'conf_two')
end
end