diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/testing/assertions/response.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/response.rb | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/response.rb b/actionpack/lib/action_dispatch/testing/assertions/response.rb index 3335742d47..7381617dd7 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/response.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/response.rb @@ -6,13 +6,6 @@ module ActionDispatch module ResponseAssertions extend ActiveSupport::Concern - included do - # TODO: Need to pull in AV::Template monkey patches that track which - # templates are rendered. assert_template should probably be part - # of AV instead of AD. - require 'action_view/test_case' - end - # Asserts that the response is one of the following types: # # * <tt>:success</tt> - Status code was 200 @@ -62,16 +55,14 @@ module ActionDispatch # assert_redirected_to @customer # def assert_redirected_to(options = {}, message=nil) - validate_request! - assert_response(:redirect, message) return true if options == @response.location - redirected_to_after_normalisation = normalize_argument_to_redirection(@response.location) - options_after_normalisation = normalize_argument_to_redirection(options) + redirect_is = normalize_argument_to_redirection(@response.location) + redirect_expected = normalize_argument_to_redirection(options) - if redirected_to_after_normalisation != options_after_normalisation - flunk "Expected response to be a redirect to <#{options_after_normalisation}> but was a redirect to <#{redirected_to_after_normalisation}>" + if redirect_is != redirect_expected + flunk "Expected response to be a redirect to <#{redirect_expected}> but was a redirect to <#{redirect_is}>" end end |