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-29 09:05:31 -07:00
parent e709d080b4
commit 10f0edac20
3 changed files with 3 additions and 9 deletions

View file

@ -17,9 +17,7 @@ describe Api::V1::RoomsController do
expect(response).to be_success
expect(json.length).to eq(2)
expect(json[0]['name']).to eq('Conference Room')
expect(json[1]['name']).to eq('Test Room')
expect(json.map { |r| r['name'] }).to contain_exactly('Conference Room', 'Test Room')
end
end