summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/requests/get_index_request.rb
blob: 2875b28f38268d9ca0c5d64e6e920cac48fde5bd (plain)
1
2
3
4
5
6
7
8
9
10
# frozen_string_literal: true

RSpec.shared_examples 'a GET index request' do
  it 'returns a 200 http status and the requested resources' do
    get(route, headers:)
    expect(response).to have_http_status(200)
    resources = JSON.parse(response.body)
    expect(resources['data'].length).to eq(pagination_size)
  end
end