Class: Shoulda::Matchers::ActionController::RenderTemplateMatcher
- Inherits:
-
Object
- Object
- Shoulda::Matchers::ActionController::RenderTemplateMatcher
- Defined in:
- lib/shoulda/matchers/action_controller/render_template_matcher.rb
Instance Attribute Summary collapse
-
#failure_message ⇒ Object
readonly
Returns the value of attribute failure_message.
-
#failure_message_when_negated ⇒ Object
readonly
Returns the value of attribute failure_message_when_negated.
Instance Method Summary collapse
- #description ⇒ Object
- #in_context(context) ⇒ Object
-
#initialize(options, message, context) ⇒ RenderTemplateMatcher
constructor
A new instance of RenderTemplateMatcher.
- #matches?(controller) ⇒ Boolean
Constructor Details
#initialize(options, message, context) ⇒ RenderTemplateMatcher
Returns a new instance of RenderTemplateMatcher.
47 48 49 50 51 52 53 54 55 |
# File 'lib/shoulda/matchers/action_controller/render_template_matcher.rb', line 47 def initialize(, , context) = = @template = .is_a?(Hash) ? [:partial] : @context = context @controller = nil = nil = nil end |
Instance Attribute Details
#failure_message ⇒ Object (readonly)
Returns the value of attribute failure_message.
45 46 47 |
# File 'lib/shoulda/matchers/action_controller/render_template_matcher.rb', line 45 def end |
#failure_message_when_negated ⇒ Object (readonly)
Returns the value of attribute failure_message_when_negated.
45 46 47 |
# File 'lib/shoulda/matchers/action_controller/render_template_matcher.rb', line 45 def end |
Instance Method Details
#description ⇒ Object
62 63 64 |
# File 'lib/shoulda/matchers/action_controller/render_template_matcher.rb', line 62 def description "render template #{@template}" end |
#in_context(context) ⇒ Object
66 67 68 69 |
# File 'lib/shoulda/matchers/action_controller/render_template_matcher.rb', line 66 def in_context(context) @context = context self end |
#matches?(controller) ⇒ Boolean
57 58 59 60 |
# File 'lib/shoulda/matchers/action_controller/render_template_matcher.rb', line 57 def matches?(controller) @controller = controller renders_template? end |