Class: RSpec::Rails::Matchers::RedirectTo::RedirectTo
- Inherits:
-
Matchers::BuiltIn::BaseMatcher
- Object
- Matchers::BuiltIn::BaseMatcher
- RSpec::Rails::Matchers::RedirectTo::RedirectTo
- Defined in:
- lib/rspec/rails/matchers/redirect_to.rb
Instance Method Summary (collapse)
- - (Object) failure_message_for_should private
- - (Object) failure_message_for_should_not private
-
- (RedirectTo) initialize(scope, expected)
constructor
A new instance of RedirectTo.
- - (Boolean) matches?(_) private
Constructor Details
- (RedirectTo) initialize(scope, expected)
Returns a new instance of RedirectTo
5 6 7 8 |
# File 'lib/rspec/rails/matchers/redirect_to.rb', line 5 def initialize(scope, expected) @expected = expected @scope = scope end |
Instance Method Details
- (Object) failure_message_for_should
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 |
# File 'lib/rspec/rails/matchers/redirect_to.rb', line 18 def rescued_exception. end |
- (Object) failure_message_for_should_not
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/rspec/rails/matchers/redirect_to.rb', line 23 def "expected not to redirect to #{@expected.inspect}, but did" end |
- (Boolean) matches?(_)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 14 15 |
# File 'lib/rspec/rails/matchers/redirect_to.rb', line 11 def matches?(_) match_unless_raises ActiveSupport::TestCase::Assertion do @scope.assert_redirected_to(@expected) end end |