2024-03-15 11:17:45 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
RSpec::Matchers.define :include_pagination_headers do |links|
|
|
|
|
match do |response|
|
|
|
|
links.map do |key, value|
|
2024-09-05 22:05:38 +02:00
|
|
|
expect(response).to have_http_link_header(value).for(rel: key.to_s)
|
2024-03-15 11:17:45 +01:00
|
|
|
end.all?
|
|
|
|
end
|
|
|
|
|
2024-07-25 16:28:08 +02:00
|
|
|
failure_message do |response|
|
|
|
|
"expected that #{response.headers['Link']} would have the same values as #{links}."
|
2024-03-15 11:17:45 +01:00
|
|
|
end
|
|
|
|
end
|