summaryrefslogtreecommitdiff
path: root/spec/support/matchers/pagination_matcher.rb
blob: 9a7697e2bfc1e8d4824c4c3ac038adf0e0c4fa68 (plain)
1
2
3
4
5
6
7
8
9
10
11
RSpec::Matchers.define :include_pagination_headers do |expected|
  match do |actual|
    expect(actual.headers).to include('X-Total', 'X-Total-Pages', 'X-Per-Page', 'X-Page', 'X-Next-Page', 'X-Prev-Page', 'Link')
  end
end

RSpec::Matchers.define :include_limited_pagination_headers do |expected|
  match do |actual|
    expect(actual.headers).to include('X-Per-Page', 'X-Page', 'X-Next-Page', 'X-Prev-Page', 'Link')
  end
end