Class: Shoulda::ActionController::Matchers::RedirectToMatcher
- Inherits:
-
Object
- Object
- Shoulda::ActionController::Matchers::RedirectToMatcher
- Defined in:
- lib/shoulda/action_controller/matchers/redirect_to_matcher.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#failure_message ⇒ Object
readonly
Returns the value of attribute failure_message.
-
#negative_failure_message ⇒ Object
readonly
Returns the value of attribute negative_failure_message.
Instance Method Summary collapse
- #description ⇒ Object
- #in_context(context) ⇒ Object
-
#initialize(url_or_description, context, &block) ⇒ RedirectToMatcher
constructor
A new instance of RedirectToMatcher.
- #matches?(controller) ⇒ Boolean
Constructor Details
#initialize(url_or_description, context, &block) ⇒ RedirectToMatcher
Returns a new instance of RedirectToMatcher.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/shoulda/action_controller/matchers/redirect_to_matcher.rb', line 17 def initialize(url_or_description, context, &block) if block @url_block = block @location = @url_or_description else @url = url_or_description @location = @url end @context = context end |
Instance Attribute Details
#failure_message ⇒ Object (readonly)
Returns the value of attribute failure_message.
38 39 40 |
# File 'lib/shoulda/action_controller/matchers/redirect_to_matcher.rb', line 38 def @failure_message end |
#negative_failure_message ⇒ Object (readonly)
Returns the value of attribute negative_failure_message.
38 39 40 |
# File 'lib/shoulda/action_controller/matchers/redirect_to_matcher.rb', line 38 def @negative_failure_message end |
Instance Method Details
#description ⇒ Object
40 41 42 |
# File 'lib/shoulda/action_controller/matchers/redirect_to_matcher.rb', line 40 def description "redirect to #{@location}" end |
#in_context(context) ⇒ Object
28 29 30 31 |
# File 'lib/shoulda/action_controller/matchers/redirect_to_matcher.rb', line 28 def in_context(context) @context = context self end |
#matches?(controller) ⇒ Boolean
33 34 35 36 |
# File 'lib/shoulda/action_controller/matchers/redirect_to_matcher.rb', line 33 def matches?(controller) @controller = controller redirects_to_url? end |