Module | Merb::Test::Rspec::ControllerMatchers |
In: |
lib/merb-core/test/matchers/controller_matchers.rb
|
Passes if the request that generated the target was missing, or the target is a client-side error (400 level) response code.
# Passes if the controller call was unknown or not understood controller.should be_missing # Also passes if the target is a response code controller.status.should be_missing
valid HTTP Client Error codes:
Passes if the controller actually provides the target format
expected<Symbol>: | A format to check |
ControllerClass.should provide( :html ) controller_instance.should provide( :xml )
Passes if the target was redirected, or the target is a redirection (300 level) response code.
# Passes if the controller was redirected controller.should redirect # Also works if the target is the response code controller.status.should redirect
valid HTTP Redirection codes:
Passes if the target was redirected to the expected location.
expected<String>: | A relative or absolute url. |
# Passes if the controller was redirected to http://example.com/ controller.should redirect_to('http://example.com/')
Passes if the request that generated the target was successful, or the target is a success (200 level) response code.
# Passes if the controller call was successful controller.should respond_successfully # Also works if the target is the response code controller.status.should respond_successfully
valid HTTP Success codes: