diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-22 22:22:20 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-22 22:22:20 +0000 |
commit | 9ab8d4d9edd9dd136b8ec0a77ce9512b4171fd52 (patch) | |
tree | 2259e117d3728de98cce32a66c06fdae68549358 /actionpack/lib/action_controller/assertions | |
parent | 766fbce04e9d24de36c9cb9cfe719f3814cedc11 (diff) | |
download | rails-9ab8d4d9edd9dd136b8ec0a77ce9512b4171fd52.tar.gz rails-9ab8d4d9edd9dd136b8ec0a77ce9512b4171fd52.tar.bz2 rails-9ab8d4d9edd9dd136b8ec0a77ce9512b4171fd52.zip |
Improve the error message for assert_redirected_to (closes #7337) [sandofsky]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7578 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/assertions')
-rw-r--r-- | actionpack/lib/action_controller/assertions/response_assertions.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/assertions/response_assertions.rb b/actionpack/lib/action_controller/assertions/response_assertions.rb index f45727f508..a2831aff67 100644 --- a/actionpack/lib/action_controller/assertions/response_assertions.rb +++ b/actionpack/lib/action_controller/assertions/response_assertions.rb @@ -78,9 +78,8 @@ module ActionController url[key] = value end - @response_diff = url[:expected].diff(url[:actual]) if url[:actual] - msg = build_message(message, "response is not a redirection to all of the options supplied (redirection is <?>), difference: <?>", - url[:actual], @response_diff) + @response_diff = url[:actual].diff(url[:expected]) if url[:actual] + msg = build_message(message, "expected a redirect to <?>, found one to <?>, a difference of <?> ", url[:expected], url[:actual], @response_diff) assert_block(msg) do url[:expected].keys.all? do |k| |