Module: Rspec::ControllerRenderTemplateMacro::ExampleGroupMethods

Defined in:
lib/rspec/controller_render_template_macro.rb

Defined Under Namespace

Classes: RenderTemplateProxy

Instance Method Summary collapse

Instance Method Details

#it_should_render_template(template_string = nil) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/rspec/controller_render_template_macro.rb', line 14

def it_should_render_template(template_string=nil)
  if template_string.nil?
    RenderTemplateProxy.new(self)
  else
    it_should_render_template_with_template_string(template_string)
  end
end

#it_should_render_template_with_template_string(template_string) ⇒ Object



22
23
24
25
26
27
# File 'lib/rspec/controller_render_template_macro.rb', line 22

def it_should_render_template_with_template_string(template_string)
  it "should render template #{template_string}" do
    do_action
    response.should render_template(template_string)
  end
end