Module: RSpec::Rails::Matchers::RedirectTo

Included in:
ControllerExampleGroup, RequestExampleGroup, SystemExampleGroup
Defined in:
lib/rspec/rails/matchers/redirect_to.rb

Overview

Matcher for redirects.

Instance Method Summary collapse

Instance Method Details

#redirect_to(target) ⇒ Object

Delegates to assert_redirected_to.

Examples:

expect(response).to redirect_to(:action => "new")
32
33
34
# File 'lib/rspec/rails/matchers/redirect_to.rb', line 32
def redirect_to(target)
  RedirectTo.new(self, target)
end