module RSpecApi::Expectations::Response::Headers

Creates an example group for expectations on the response headers of last API request and runs it to verify that it matches best practices:

Public Instance Methods

expect_headers(response, expectations = {}) click to toggle source
# File lib/rspec-api/expectations/headers.rb, line 12
def expect_headers(response, expectations = {})
  context 'responds with headers that' do
    extend ContentType
    extend PageLinks

    expect_content_type response, expectations
    expect_page_links response, expectations
  end if expectations.any?
end