1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00
mastodon/spec/support/matchers/api_pagination.rb

14 lines
349 B
Ruby
Raw Normal View History

# frozen_string_literal: true
RSpec::Matchers.define :include_pagination_headers do |links|
match do |response|
links.map do |key, value|
response.headers['Link'].find_link(['rel', key.to_s]).href == value
end.all?
end
failure_message do |header|
"expected that #{header} would have the same values as #{links}."
end
end