Class: Shoulda::ActionController::Matchers::RenderTemplateMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/shoulda/action_controller/matchers/render_template_matcher.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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_messageObject (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
  @failure_message
end

#negative_failure_messageObject (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
  @negative_failure_message
end

Instance Method Details

#descriptionObject



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

Returns:

  • (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