Module: RSpecApi::Expectations::Response::Status::Code

Defined in:
lib/rspec-api/expectations/status/code.rb

Instance Method Summary collapse

Instance Method Details

#expect_status_code(response, expectations = {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/rspec-api/expectations/status/code.rb', line 8

def expect_status_code(response, expectations = {})
  include RSpecApi::Matchers

  if should_check_status_code(response, expectations)
    it { expect(response).to have_status expectations[:status] }
  end
end