Merge pull request #2652 from AndrewKvalheim/test-unspecified-order-2

Decouple tests from unspecified data ordering (part 2)
This commit is contained in:
Stella Rouzi 2020-04-06 15:26:07 +03:00 committed by GitHub
commit 303129bf45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 11 deletions

View file

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

View file

@ -15,7 +15,7 @@ describe Api::V1::EventsController do
json = JSON.parse(response.body)['events']
expect(response).to be_success
expect(json.map { |e| e['title'] }).to contain_exactly('Conference Event', 'Example Event')
expect(json.pluck('title')).to contain_exactly('Conference Event', 'Example Event')
end
end

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.pluck('name')).to contain_exactly('Conference Room', 'Test Room')
end
end

View file

@ -22,9 +22,7 @@ describe Api::V1::SpeakersController do
get :index, params: { format: :json }
json = JSON.parse(response.body)['speakers']
expect(response).to be_success
expect(json.length).to eq(2)
expect(json[0]['name']).to eq('Speaker')
expect(json[1]['name']).to eq('Conf_Speaker')
expect(json.pluck('name')).to contain_exactly('Conf_Speaker', 'Speaker')
end
end

View file

@ -16,9 +16,7 @@ describe Api::V1::TracksController do
expect(response).to be_success
expect(json.length).to eq(2)
expect(json[0]['name']).to eq('Conference Track')
expect(json[1]['name']).to eq('Test Track')
expect(json.pluck('name')).to contain_exactly('Conference Track', 'Test Track')
end
end