Module: ResponseMatchers
- Defined in:
- lib/responses.rb,
lib/use_layout.rb
Overview
Module for testing the layout used in a response object
Defined Under Namespace
Classes: ResponseLocationMatcher, ResponseStatusMatcher, UseLayout
Instance Method Summary collapse
-
#be_an_error ⇒ Object
test for a 500 internal server error.
-
#be_not_acceptable ⇒ Object
test for a 406 response.
-
#be_not_found ⇒ Object
test for a 404 response.
-
#be_successfully_created ⇒ Object
test for a 201 response.
-
#be_unauthorised ⇒ Object
(also: #be_unauthorized)
test for a 401 response.
-
#be_unprocessable ⇒ Object
test for a 422 response.
-
#point_to(url) ⇒ Object
test that the location points to a given URI.
- #use_layout(expected) ⇒ Object
Instance Method Details
#be_an_error ⇒ Object
test for a 500 internal server error
32 33 34 |
# File 'lib/responses.rb', line 32 def be_an_error ResponseStatusMatcher.new "500 Internal Error" end |
#be_not_acceptable ⇒ Object
test for a 406 response
27 28 29 |
# File 'lib/responses.rb', line 27 def be_not_acceptable ResponseStatusMatcher.new "406 Not Acceptable" end |
#be_not_found ⇒ Object
test for a 404 response
16 17 18 |
# File 'lib/responses.rb', line 16 def be_not_found ResponseStatusMatcher.new "404 Not Found" end |
#be_successfully_created ⇒ Object
test for a 201 response
6 7 8 |
# File 'lib/responses.rb', line 6 def be_successfully_created ResponseStatusMatcher.new "201 Created" end |
#be_unauthorised ⇒ Object Also known as:
test for a 401 response
21 22 23 |
# File 'lib/responses.rb', line 21 def ResponseStatusMatcher.new "401 Unauthorized" end |
#be_unprocessable ⇒ Object
test for a 422 response
11 12 13 |
# File 'lib/responses.rb', line 11 def be_unprocessable ResponseStatusMatcher.new "422 Unprocessable Entity" end |
#point_to(url) ⇒ Object
test that the location points to a given URI
37 38 39 |
# File 'lib/responses.rb', line 37 def point_to url ResponseLocationMatcher.new url end |