diff options
author | Alexey Chernenkov <laise@pisem.net> | 2013-05-30 20:05:13 +0600 |
---|---|---|
committer | Alexey Chernenkov <laise@pisem.net> | 2013-07-18 10:54:36 +0600 |
commit | 0f5ba6e124b583fa0c92fc6e82fff124673d8e0d (patch) | |
tree | 6d8c11c51ccffd60707fc8f64bcb20f501a12abb /actionpack/lib/action_dispatch/testing | |
parent | ac5cc6957142f2b22eee0f86710fa18f60313aec (diff) | |
download | rails-0f5ba6e124b583fa0c92fc6e82fff124673d8e0d.tar.gz rails-0f5ba6e124b583fa0c92fc6e82fff124673d8e0d.tar.bz2 rails-0f5ba6e124b583fa0c92fc6e82fff124673d8e0d.zip |
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.
Diffstat (limited to 'actionpack/lib/action_dispatch/testing')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/response.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |