diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-27 05:36:03 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-27 05:36:03 +0000 |
commit | 2269c23699968d31f2f81052ebcf7fcc29e82502 (patch) | |
tree | 68b5cb806b3b6f227fb04c0182a4feee1e04a1aa /actionpack/lib/action_controller/assertions.rb | |
parent | de1f231c32155c10e4b03c3b861a885786dc9f59 (diff) | |
download | rails-2269c23699968d31f2f81052ebcf7fcc29e82502.tar.gz rails-2269c23699968d31f2f81052ebcf7fcc29e82502.tar.bz2 rails-2269c23699968d31f2f81052ebcf7fcc29e82502.zip |
Fixed assert_redirected_to to handle absolute controller paths properly #1472 [Rick Olson/Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1533 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/assertions.rb')
-rw-r--r-- | actionpack/lib/action_controller/assertions.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/assertions.rb b/actionpack/lib/action_controller/assertions.rb index f2eb2fd2f4..b19ccc3b2b 100644 --- a/actionpack/lib/action_controller/assertions.rb +++ b/actionpack/lib/action_controller/assertions.rb @@ -78,8 +78,10 @@ module Test #:nodoc: if options.is_a?(Symbol) @response.redirected_to == options else - options.keys.all? do |k| - options[k] == (@response.redirected_to[k].respond_to?(:to_param) ? @response.redirected_to[k].to_param : @response.redirected_to[k] unless @response.redirected_to[k].nil?) + options.keys.all? do |k| + if k == :controller then options[k] == ActionController::Routing.controller_relative_to(@response.redirected_to[k], @controller.class.controller_path) + else options[k] == (@response.redirected_to[k].respond_to?(:to_param) ? @response.redirected_to[k].to_param : @response.redirected_to[k] unless @response.redirected_to[k].nil?) + end end end end |