From 0f5ba6e124b583fa0c92fc6e82fff124673d8e0d Mon Sep 17 00:00:00 2001 From: Alexey Chernenkov Date: Thu, 30 May 2013 20:05:13 +0600 Subject: Fix `assert_redirected_to` does not show user-supplied message. Issue: when `assert_redirected_to` fails due to the response redirect not matching the expected redirect the user-supplied message (second parameter) is not shown. This message is only shown if the response is not a redirect. --- actionpack/lib/action_dispatch/testing/assertions/response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/testing') diff --git a/actionpack/lib/action_dispatch/testing/assertions/response.rb b/actionpack/lib/action_dispatch/testing/assertions/response.rb index 6886ff2a03..cd3329c3a5 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/response.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/response.rb @@ -62,7 +62,7 @@ module ActionDispatch redirect_expected = normalize_argument_to_redirection(options) if redirect_is != redirect_expected - flunk "Expected response to be a redirect to <#{redirect_expected}> but was a redirect to <#{redirect_is}>" + flunk(build_message(message, "Expected response to be a redirect to but was a redirect to ", redirect_expected, redirect_is)) end end -- cgit v1.2.3