Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Commit

Permalink
Check for specific items in after_id spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter St.Jean committed Jun 21, 2018
1 parent aac033f commit e8942d2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions spec/requests/bragi/items_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ module Bragi
expect(response).to have_http_status(200)
json = JSON.parse response.body
expect(json['data'].size).to eq 3
json['data'].each do |item|
expect(item['attributes']['status']).to be_in(%w[unplayed playing])
end
expect(json['data'][0]['id']).to eq item5.id.to_s
expect(json['data'][1]['id']).to eq item1.id.to_s
expect(json['data'][2]['id']).to eq item7.id.to_s
end

it 'fetches by after_id and status' do
Expand All @@ -168,9 +168,8 @@ module Bragi
expect(response).to have_http_status(200)
json = JSON.parse response.body
expect(json['data'].size).to eq 2
json['data'].each do |item|
expect(item['attributes']['status']).to eq 'unplayed'
end
expect(json['data'][0]['id']).to eq item1.id.to_s
expect(json['data'][1]['id']).to eq item7.id.to_s
end

it 'returns no items if after_id is last item' do
Expand Down

0 comments on commit e8942d2

Please sign in to comment.