Class: Merb::Test::Rspec::ControllerMatchers::BeRedirect
- Inherits:
-
Object
- Object
- Merb::Test::Rspec::ControllerMatchers::BeRedirect
- Defined in:
- merb-core/lib/merb-core/test/matchers/controller_matchers.rb
Instance Method Summary (collapse)
-
- (String) failure_message
The failure message.
-
- (String) inspect_target
The controller and action name.
-
- (Boolean) matches?(target)
True if the status code is in the range 300..305 or 307.
-
- (String) negative_failure_message
The failure message to be displayed in negative matches.
Instance Method Details
- (String) failure_message
The failure message.
14 15 16 |
# File 'merb-core/lib/merb-core/test/matchers/controller_matchers.rb', line 14 def "expected#{inspect_target} to redirect" end |
- (String) inspect_target
The controller and action name.
24 25 26 |
# File 'merb-core/lib/merb-core/test/matchers/controller_matchers.rb', line 24 def inspect_target " #{@target.controller_name}##{@target.action_name}" if @target.respond_to?(:controller_name) && @target.respond_to?(:action_name) end |
- (Boolean) matches?(target)
True if the status code is in the range 300..305 or 307.
8 9 10 11 |
# File 'merb-core/lib/merb-core/test/matchers/controller_matchers.rb', line 8 def matches?(target) @target = target [307, *(300..305)].include?(target.respond_to?(:status) ? target.status : target) end |
- (String) negative_failure_message
The failure message to be displayed in negative matches.
19 20 21 |
# File 'merb-core/lib/merb-core/test/matchers/controller_matchers.rb', line 19 def "expected#{inspect_target} not to redirect" end |