diff options
author | thoefer <mail@tomhoefer.de> | 2011-07-26 11:42:53 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:18 -0700 |
commit | 39183f4ede48db822044abd8e15e6c7f7e93cdd8 (patch) | |
tree | 5b84bc149288eb345e01828d1c073a7436ede4cf | |
parent | b36a710e713d83436f828e666fd7181e340f7878 (diff) | |
download | rails-39183f4ede48db822044abd8e15e6c7f7e93cdd8.tar.gz rails-39183f4ede48db822044abd8e15e6c7f7e93cdd8.tar.bz2 rails-39183f4ede48db822044abd8e15e6c7f7e93cdd8.zip |
refactored 'assert_redirected_to': local call to validate_request! will be called in assert_response already. changed names of local variables in order to recognize the semantics a bit easier.
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/response.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/response.rb b/actionpack/lib/action_dispatch/testing/assertions/response.rb index a2d639cd56..33c6cd5221 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/response.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/response.rb @@ -55,16 +55,15 @@ 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_normalization = normalize_argument_to_redirection(@response.location) - options_after_normalization = normalize_argument_to_redirection(options) + redirect_is = normalize_argument_to_redirection(@response.location) + redirect_expected = normalize_argument_to_redirection(options) - if redirected_to_after_normalization != options_after_normalization - flunk "Expected response to be a redirect to <#{options_after_normalization}> but was a redirect to <#{redirected_to_after_normalization}>" + if redirect_is != redirect_expected + flunk "Expected response to be a redirect to <#{redirect_expected}> but was a redirect to <#{redirect_is}>" end end |