diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-05-02 14:23:44 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-05-02 14:23:44 -0500 |
commit | 3900f4007ee6463b8936af23c04017a900673866 (patch) | |
tree | 216e69d5b5426702fe7009f3203ee897e5f92bc2 /actionpack/lib/action_dispatch/testing | |
parent | 3be3470fab788856b4559742434f195cc6b1009a (diff) | |
download | rails-3900f4007ee6463b8936af23c04017a900673866.tar.gz rails-3900f4007ee6463b8936af23c04017a900673866.tar.bz2 rails-3900f4007ee6463b8936af23c04017a900673866.zip |
Deprecate assert_redirect_to's partial hash matching
Diffstat (limited to 'actionpack/lib/action_dispatch/testing')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/response.rb | 9 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/testing/test_response.rb | 6 |
2 files changed, 8 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/response.rb b/actionpack/lib/action_dispatch/testing/assertions/response.rb index a72ce9084f..92e3da580e 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/response.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/response.rb @@ -60,14 +60,9 @@ module ActionDispatch validate_request! assert_response(:redirect, message) - return true if options == @response.redirected_to + return true if options == @response.location - # Support partial arguments for hash redirections - if options.is_a?(Hash) && @response.redirected_to.is_a?(Hash) - return true if options.all? {|(key, value)| @response.redirected_to[key] == value} - end - - redirected_to_after_normalisation = normalize_argument_to_redirection(@response.redirected_to) + redirected_to_after_normalisation = normalize_argument_to_redirection(@response.location) options_after_normalisation = normalize_argument_to_redirection(options) if redirected_to_after_normalisation != options_after_normalisation diff --git a/actionpack/lib/action_dispatch/testing/test_response.rb b/actionpack/lib/action_dispatch/testing/test_response.rb index 50c6d85828..c5464f1559 100644 --- a/actionpack/lib/action_dispatch/testing/test_response.rb +++ b/actionpack/lib/action_dispatch/testing/test_response.rb @@ -1,4 +1,10 @@ module ActionDispatch + # Integration test methods such as ActionController::Integration::Session#get + # and ActionController::Integration::Session#post return objects of class + # TestResponse, which represent the HTTP response results of the requested + # controller actions. + # + # See Response for more information on controller response objects. class TestResponse < Response def self.from_response(response) new.tap do |resp| |