Class: RSpecApi::Matchers::PageLinks::Matcher

Inherits:
Headers::Matcher show all
Defined in:
lib/rspec-api/matchers/page_links/matcher.rb

Instance Attribute Summary

Attributes inherited from Response::Matcher

#response

Instance Method Summary collapse

Methods inherited from Response::Matcher

#failure_message_for_should, #failure_message_for_should_not

Instance Method Details

#descriptionObject



12
13
14
# File 'lib/rspec-api/matchers/page_links/matcher.rb', line 12

def description
  %Q{include a 'Link' to the previous page}
end

#matches?(response) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
# File 'lib/rspec-api/matchers/page_links/matcher.rb', line 7

def matches?(response)
  # NOTE: Only use headers.fetch('Link', '') after http://git.io/CUz3-Q
  super && (headers['Link'] || '') =~ %r{<.+?>. rel\="prev"}
end