1
0

api_pagination.rb 369 B

12345678910111213
  1. # frozen_string_literal: true
  2. RSpec::Matchers.define :include_pagination_headers do |links|
  3. match do |response|
  4. links.map do |key, value|
  5. expect(response).to have_http_link_header(value).for(rel: key.to_s)
  6. end.all?
  7. end
  8. failure_message do |response|
  9. "expected that #{response.headers['Link']} would have the same values as #{links}."
  10. end
  11. end