diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-11-25 00:10:45 -0800 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-11-25 00:10:45 -0800 |
commit | 051a520b8c920cd6ed15f9e237343a306b7bdfa0 (patch) | |
tree | 1884d7aac3fc0d32bc45bafa7cf53f22a63493eb /actionpack/lib/action_dispatch/testing/assertions | |
parent | 9dc89f3fc425af5cfc5fa5ea3809e554db017653 (diff) | |
parent | c759a93454b10d9a908d3a3a102546fc70160b91 (diff) | |
download | rails-051a520b8c920cd6ed15f9e237343a306b7bdfa0.tar.gz rails-051a520b8c920cd6ed15f9e237343a306b7bdfa0.tar.bz2 rails-051a520b8c920cd6ed15f9e237343a306b7bdfa0.zip |
Merge pull request #13025 from pwnall/nice_test
Better error message for typos in assert_response argument.
Diffstat (limited to 'actionpack/lib/action_dispatch/testing/assertions')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/response.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/response.rb b/actionpack/lib/action_dispatch/testing/assertions/response.rb index 93f9fab9c2..68feb26936 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/response.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/response.rb @@ -27,6 +27,9 @@ module ActionDispatch assert @response.send("#{type}?"), message else code = Rack::Utils::SYMBOL_TO_STATUS_CODE[type] + if code.nil? + raise ArgumentError, "Invalid response type :#{type}" + end assert_equal code, @response.response_code, message end else |