From 2c8dfa746b42a39df13e7aa57a11a32171c47c16 Mon Sep 17 00:00:00 2001 From: David Trasbo Date: Wed, 14 Apr 2010 22:42:25 +0200 Subject: [PATCH] Make assert_redirected_to display custom message in all failure scenarios --- .../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 ec5e9ef..f29feab 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/response.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/response.rb @@ -69,7 +69,7 @@ module ActionDispatch options_after_normalisation = normalize_argument_to_redirection(options) if redirected_to_after_normalisation != options_after_normalisation - flunk "Expected response to be a redirect to <#{options_after_normalisation}> but was a redirect to <#{redirected_to_after_normalisation}>" + flunk(message || "Expected response to be a redirect to <#{options_after_normalisation}> but was a redirect to <#{redirected_to_after_normalisation}>") end end -- 1.7.0.3