aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/assertions/response_assertions.rb5
-rwxr-xr-xactionpack/test/controller/redirect_test.rb4
2 files changed, 4 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/assertions/response_assertions.rb b/actionpack/lib/action_controller/assertions/response_assertions.rb
index 4108695f07..09fb4f9a1b 100644
--- a/actionpack/lib/action_controller/assertions/response_assertions.rb
+++ b/actionpack/lib/action_controller/assertions/response_assertions.rb
@@ -79,9 +79,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|
diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb
index 7ab1ddde0c..4a3b8254aa 100755
--- a/actionpack/test/controller/redirect_test.rb
+++ b/actionpack/test/controller/redirect_test.rb
@@ -162,11 +162,11 @@ class RedirectTest < Test::Unit::TestCase
begin
assert_redirected_to :action => "other_host", :only_path => true
rescue Test::Unit::AssertionFailedError => err
- redirection_msg, diff_msg = err.message.scan(/<\{[^\}]+\}>/).collect { |s| s[2..-3] }
+ expected_msg, redirection_msg, diff_msg = err.message.scan(/<\{[^\}]+\}>/).collect { |s| s[2..-3] }
assert_match %r("only_path"=>false), redirection_msg
assert_match %r("host"=>"other.test.host"), redirection_msg
assert_match %r("action"=>"other_host"), redirection_msg
- assert_match %r("only_path"=>true), diff_msg
+ assert_match %r("only_path"=>false), diff_msg
assert_match %r("host"=>"other.test.host"), diff_msg
end
end