Parent

Class Index [+]

Quicksearch

Merb::Test::Rspec::ControllerMatchers::BeRedirect

Public Instance Methods

failure_message() click to toggle source

Returns

String

The failure message.

    # File lib/merb-core/test/matchers/controller_matchers.rb, line 17
17:     def failure_message
18:       "expected#{inspect_target} to redirect"
19:     end
inspect_target() click to toggle source

Returns

String

The controller and action name.

    # File lib/merb-core/test/matchers/controller_matchers.rb, line 29
29:     def inspect_target
30:       " #{@target.controller_name}##{@target.action_name}" if @target.respond_to?(:controller_name) && @target.respond_to?(:action_name)
31:     end
matches?(target) click to toggle source

Parameters

target

Either the status code or a controller with a status code.

Returns

Boolean

True if the status code is in the range 300..305 or 307.

    # File lib/merb-core/test/matchers/controller_matchers.rb, line 10
10:     def matches?(target)
11:       @target = target
12:       [307, *(300..305)].include?(target.respond_to?(:status) ? target.status : target)
13:     end
negative_failure_message() click to toggle source

Returns

String

The failure message to be displayed in negative matches.

    # File lib/merb-core/test/matchers/controller_matchers.rb, line 23
23:     def negative_failure_message
24:       "expected#{inspect_target} not to redirect"
25:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.