Module: Test::Spec::Rails::ShouldRender

Defined in:
lib/test/spec/rails/should_render.rb

Instance Method Summary collapse

Instance Method Details

#render(template = '', response = :success) ⇒ Object

Test that something was rendered:

request.should.render

Test that a specific template was rendered:

request.should.render 'foo'

Test that a template was rendered with a specific response code:

request.should.render 'foo', :error


11
12
13
14
# File 'lib/test/spec/rails/should_render.rb', line 11

def render(template = '', response = :success)
  @object.assert_response response
  @object.assert_template template unless template.blank?
end