diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-01-05 02:19:48 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-01-05 02:19:48 +0000 |
commit | 3464a7e79c373947ea7d57c543e36f41bd62049e (patch) | |
tree | 263bf0024f4334a3276922e3c062cc5c3674e61d /actionpack/lib | |
parent | 5ccc3cf448c5ba41761d1f50a476f6793331511d (diff) | |
download | rails-3464a7e79c373947ea7d57c543e36f41bd62049e.tar.gz rails-3464a7e79c373947ea7d57c543e36f41bd62049e.tar.bz2 rails-3464a7e79c373947ea7d57c543e36f41bd62049e.zip |
assert_response failures include the exception message. Closes #10688.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8559 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/assertions/response_assertions.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/assertions/response_assertions.rb b/actionpack/lib/action_controller/assertions/response_assertions.rb index 42bd7fb3d2..67dd3a5724 100644 --- a/actionpack/lib/action_controller/assertions/response_assertions.rb +++ b/actionpack/lib/action_controller/assertions/response_assertions.rb @@ -33,7 +33,11 @@ module ActionController elsif type.is_a?(Symbol) && @response.response_code == ActionController::StatusCodes::SYMBOL_TO_STATUS_CODE[type] assert_block("") { true } # to count the assertion else - assert_block(build_message(message, "Expected response to be a <?>, but was <?>", type, @response.response_code)) { false } + if @response.error? + assert_block(build_message(message, "Expected response to be a <?>, but was <?>\n<?>", type, @response.response_code, @response.template.instance_variable_get(:@exception).message)) { false } + else + assert_block(build_message(message, "Expected response to be a <?>, but was <?>", type, @response.response_code)) { false } + end end end end |