class Shoulda::Matchers::ActionController::RenderTemplateMatcher
@private
Attributes
Public Class Methods
Source
# File lib/shoulda/matchers/action_controller/render_template_matcher.rb, line 47 def initialize(options, message, context) @options = options @message = message @template = options.is_a?(Hash) ? options[:partial] : options @context = context @controller = nil @failure_message = nil @failure_message_when_negated = nil end
Public Instance Methods
Source
# File lib/shoulda/matchers/action_controller/render_template_matcher.rb, line 62 def description "render template #{@template}" end
Source
# File lib/shoulda/matchers/action_controller/render_template_matcher.rb, line 66 def in_context(context) @context = context self end
Source
# File lib/shoulda/matchers/action_controller/render_template_matcher.rb, line 57 def matches?(controller) @controller = controller renders_template? end
Private Instance Methods
Source
# File lib/shoulda/matchers/action_controller/render_template_matcher.rb, line 73 def renders_template? @context.__send__(:assert_template, @options, @message) @failure_message_when_negated = "Didn't expect to render #{@template}" true rescue Shoulda::Matchers.assertion_exception_class => e @failure_message = e.message false end