Sha256: f034732b209248a472df33d7317d757e4fb0e2d2f12e6be4cd387d790a1c87e1

Contents?: true

Size: 1.37 KB

Versions: 25

Compression:

Stored size: 1.37 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper'
require 'controller_spec_controller'

describe "a controller spec running in isolation mode", :type => :controller do
  controller_name :controller_spec

  it "should not care if the template doesn't exist" do
    get 'some_action'
    response.should be_success
    response.should render_template("template/that/does/not/actually/exist")
  end

  it "should not care if the template has errors" do
    get 'action_with_errors_in_template'
    response.should be_success
    response.should render_template("action_with_errors_in_template")
  end
end

describe "a controller spec running in integration mode", :type => :controller do
  controller_name :controller_spec
  integrate_views
  
  before(:each) do
    controller.class.send(:define_method, :rescue_action) { |e| raise e }
  end

  it "should render a template" do
    get 'action_with_template'
    response.should be_success
    response.should have_tag('div', 'This is action_with_template.rhtml')
  end

  it "should choke if the template doesn't exist" do
    lambda { get 'some_action' }.should raise_error(ActionController::MissingTemplate)
    response.should_not be_success
  end

  it "should choke if the template has errors" do
    lambda { get 'action_with_errors_in_template' }.should raise_error(ActionView::TemplateError)
    response.should_not be_success
  end
end

Version data entries

25 entries across 25 versions & 4 rubygems

Version Path
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
picolena-0.1.0 rails_plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
picolena-0.1.1 rails_plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
picolena-0.1.3 rails_plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
picolena-0.1.4 rails_plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
picolena-0.1.2 rails_plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
picolena-0.1.5 rails_plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
radiant-0.6.5.1 vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
radiant-0.6.5 vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
radiant-0.6.7 vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
radiant-0.6.6 vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
radiant-0.6.8 vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
radiant-0.6.9 vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
spree-0.0.9 vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
spree-0.0.8 starter-app/vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
spree-0.2.0 vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
typo-5.0.2 vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
typo-5.0.1 vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
typo-5.0.3.98.1 vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
typo-5.0.3.98 vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb