From 891a962a192bdd7eb0402b41e11a5e5657fe961c Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Sun, 19 Mar 2006 03:50:14 +0000 Subject: Added nicer message for assert_redirected_to (closes #4294) [court3nay, Chris McGrath] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3969 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/assertions.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/assertions.rb b/actionpack/lib/action_controller/assertions.rb index b3f2c235d6..2402e0941b 100644 --- a/actionpack/lib/action_controller/assertions.rb +++ b/actionpack/lib/action_controller/assertions.rb @@ -85,8 +85,9 @@ module Test #:nodoc: assert_equal(eurl, url, msg) if eurl && url assert_equal(epath, path, msg) if epath && path else - msg = build_message(message, "response is not a redirection to all of the options supplied (redirection is )", - @response.redirected_to || @response.redirect_url) + @response_diff = options.diff(@response.redirected_to) if @response.redirected_to + msg = build_message(message, "response is not a redirection to all of the options supplied (redirection is ), difference: ", + @response.redirected_to || @response.redirect_url, @response_diff) assert_block(msg) do if options.is_a?(Symbol) -- cgit v1.2.3