Module: Riot::Gear::AssertsStatus

Defined in:
lib/riot/gear/context/asserts_status.rb

Instance Method Summary collapse

Instance Method Details

#asserts_status(response_name = nil) ⇒ Riot::Assertion

Generates an assertion that retrieves the status code from the last response. If a response name is provided, that named response will be used instead. The status code will be an integer.

asserts_status.equals(200)

Parameters:

  • response_name (String, Symbol) (defaults to: nil)

    Name of response to check status code of

Returns:

  • (Riot::Assertion)

    an assertion block that macros can be applied to



14
15
16
# File 'lib/riot/gear/context/asserts_status.rb', line 14

def asserts_status(response_name=nil)
  asserts("status code") { response(response_name).code }
end