Sha256: 95e6fe83b5b4530d59a1fbcedb2e17139f027241cbe20c9e292f80f5c3fbc4b9

Contents?: true

Size: 472 Bytes

Versions: 12

Compression:

Stored size: 472 Bytes

Contents

module RSpec::Rails::Matchers
  module RedirectTo
    extend RSpec::Matchers::DSL

    matcher :redirect_to do |destination|
      match_unless_raises ActiveSupport::TestCase::Assertion do |_|
        assert_redirected_to destination
      end

      failure_message_for_should do |_|
        rescued_exception.message
      end

      failure_message_for_should_not do |_|
        "expected not to redirect to #{destination.inspect}, but did"
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rspec-rails-2.8.0.rc1 lib/rspec/rails/matchers/redirect_to.rb
rspec-rails-2.7.0 lib/rspec/rails/matchers/redirect_to.rb
rspec-rails-2.7.0.rc1 lib/rspec/rails/matchers/redirect_to.rb
rspec-rails-2.6.1 lib/rspec/rails/matchers/redirect_to.rb
rspec-rails-2.6.1.beta1 lib/rspec/rails/matchers/redirect_to.rb
rspec-rails-2.6.0 lib/rspec/rails/matchers/redirect_to.rb
rspec-rails-2.6.0.rc6 lib/rspec/rails/matchers/redirect_to.rb
rspec-rails-2.6.0.rc4 lib/rspec/rails/matchers/redirect_to.rb
rspec-rails-2.6.0.rc2 lib/rspec/rails/matchers/redirect_to.rb
rspec-rails-2.5.0 lib/rspec/rails/matchers/redirect_to.rb
rspec-rails-2.4.1 lib/rspec/rails/matchers/redirect_to.rb
rspec-rails-2.4.0 lib/rspec/rails/matchers/redirect_to.rb