Class: Shoulda::ActionController::Matchers::RenderTemplateMatcher
- Inherits:
-
Object
- Object
- Shoulda::ActionController::Matchers::RenderTemplateMatcher
- Defined in:
- lib/shoulda/action_controller/matchers/render_template_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(template, context) ⇒ RenderTemplateMatcher
constructor
A new instance of RenderTemplateMatcher.
- #matches?(controller) ⇒ Boolean
Constructor Details
#initialize(template, context) ⇒ RenderTemplateMatcher
Returns a new instance of RenderTemplateMatcher.
16 17 18 19 |
# File 'lib/shoulda/action_controller/matchers/render_template_matcher.rb', line 16 def initialize(template, context) @template = template.to_s @context = context end |
Instance Attribute Details
#failure_message ⇒ Object (readonly)
Returns the value of attribute failure_message.
26 27 28 |
# File 'lib/shoulda/action_controller/matchers/render_template_matcher.rb', line 26 def @failure_message end |
#negative_failure_message ⇒ Object (readonly)
Returns the value of attribute negative_failure_message.
26 27 28 |
# File 'lib/shoulda/action_controller/matchers/render_template_matcher.rb', line 26 def @negative_failure_message end |
Instance Method Details
#description ⇒ Object
28 29 30 |
# File 'lib/shoulda/action_controller/matchers/render_template_matcher.rb', line 28 def description "render template #{@template}" end |
#in_context(context) ⇒ Object
32 33 34 35 |
# File 'lib/shoulda/action_controller/matchers/render_template_matcher.rb', line 32 def in_context(context) @context = context self end |
#matches?(controller) ⇒ Boolean
21 22 23 24 |
# File 'lib/shoulda/action_controller/matchers/render_template_matcher.rb', line 21 def matches?(controller) @controller = controller renders_template? end |