Module: RSpecApi::Expectations::Response

Includes:
Body, Custom, Headers, Status
Included in:
RSpecApi::Expectations
Defined in:
lib/rspec-api/expectations/body.rb,
lib/rspec-api/expectations/custom.rb,
lib/rspec-api/expectations/status.rb,
lib/rspec-api/expectations/headers.rb,
lib/rspec-api/expectations/response.rb,
lib/rspec-api/expectations/body/sort.rb,
lib/rspec-api/expectations/body/jsonp.rb,
lib/rspec-api/expectations/body/filter.rb,
lib/rspec-api/expectations/status/code.rb,
lib/rspec-api/expectations/body/attributes.rb,
lib/rspec-api/expectations/body/collection.rb,
lib/rspec-api/expectations/headers/page_links.rb,
lib/rspec-api/expectations/headers/content_type.rb

Defined Under Namespace

Modules: Body, Custom, Headers, Status

Instance Method Summary collapse

Methods included from Custom

#expect_custom

Methods included from Body

#expect_body

Methods included from Headers

#expect_headers

Methods included from Status

#expect_status

Instance Method Details

#expect_response(response, expectations, prefix_params = nil, &block) ⇒ Object



16
17
18
19
20
21
# File 'lib/rspec-api/expectations/response.rb', line 16

def expect_response(response, expectations, prefix_params=nil, &block)
  expect_status response, expectations.slice(*on_status)
  expect_headers response, expectations.slice(*on_headers)
  expect_body response, expectations.slice(*on_body)
  expect_custom response, prefix_params, &block if block_given?
end