Sha256: 66fa0f61643502d16278f39dc0b2d457d94a97c37d6be6da4492fde79835d541

Contents?: true

Size: 628 Bytes

Versions: 18

Compression:

Stored size: 628 Bytes

Contents

require "spec_helper"
require "action_controller/test_case"

describe "redirect_to" do
  include RSpec::Rails::Matchers::RedirectTo

  it "delegates to assert_redirected_to" do
    self.should_receive(:assert_redirected_to).with("destination")
    "response".should redirect_to("destination")
  end

  it "uses failure message from assert_redirected_to" do
    self.stub!(:assert_redirected_to).and_raise(
      Test::Unit::AssertionFailedError.new("this message"))
    response = ActionController::TestResponse.new
    expect do
      response.should redirect_to("destination")
    end.to raise_error("this message")
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rspec-rails-2.3.1 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.3.0 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.2.1 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.2.0 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.1.0 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.0.1 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.0.0 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.0.0.rc spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.0.0.beta.22 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.0.0.beta.20 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.0.0.beta.19 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.0.0.beta.18 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.0.0.beta.17 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.0.0.beta.16 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.0.0.beta.15 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.0.0.beta.14.2 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.0.0.beta.14.1 spec/rspec/rails/matchers/redirect_to_spec.rb
rspec-rails-2.0.0.beta.13 spec/rspec/rails/matchers/redirect_to_spec.rb