Sha256: 3e6c617761fe3030422146377f688e443a257807faa7e7d96f909247116ef460

Contents?: true

Size: 778 Bytes

Versions: 1

Compression:

Stored size: 778 Bytes

Contents

module Test::Spec::Rails::ShouldRender
  # 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
  #
  def render(template = '', response = :success)
    @object.assert_response response
    @object.assert_template template unless template.blank?
  end
end

module Test::Spec::Rails::ShouldNotRender
  # Test that we didn't render
  def render(template = '', response = :success)
    @object.assert_response :redirect
  end
end

Test::Spec::Should.send(:include, Test::Spec::Rails::ShouldRender)
Test::Spec::ShouldNot.send(:include, Test::Spec::Rails::ShouldNotRender)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
test_spec_on_rails-1.1.0 lib/test/spec/rails/should_render.rb