aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-12-25 09:34:01 +0000
committerRick Olson <technoweenie@gmail.com>2006-12-25 09:34:01 +0000
commit64799454a2186596c70324db2958d0fc231d6f1b (patch)
tree10f88f448ec717a572c4a0d55b2d672494d4478a /actionpack/lib/action_controller
parentc6b4c8d240abbca0d1e62b3544fafda77c40de0c (diff)
downloadrails-64799454a2186596c70324db2958d0fc231d6f1b.tar.gz
rails-64799454a2186596c70324db2958d0fc231d6f1b.tar.bz2
rails-64799454a2186596c70324db2958d0fc231d6f1b.zip
Fix assert_redirected_to bug where redirecting from a nested to to a top-level controller incorrectly added the current controller's nesting. Closes #6128. [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5785 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/assertions/response_assertions.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/assertions/response_assertions.rb b/actionpack/lib/action_controller/assertions/response_assertions.rb
index c0b78552f2..0811920e4a 100644
--- a/actionpack/lib/action_controller/assertions/response_assertions.rb
+++ b/actionpack/lib/action_controller/assertions/response_assertions.rb
@@ -70,14 +70,14 @@ module ActionController
if value.respond_to?(:[]) && value['controller']
if key == :actual && value['controller'].first != '/' && !value['controller'].include?('/')
- value['controller'] = ActionController::Routing.controller_relative_to(value['controller'], @controller.class.controller_path)
+ new_controller_path = ActionController::Routing.controller_relative_to(value['controller'], @controller.class.controller_path)
+ value['controller'] = new_controller_path if value['controller'] != new_controller_path && ActionController::Routing.possible_controllers.include?(new_controller_path)
end
value['controller'] = value['controller'][1..-1] if value['controller'].first == '/' # strip leading hash
end
url[key] = value
end
-
@response_diff = url[:expected].diff(url[:actual]) if url[:actual]
msg = build_message(message, "response is not a redirection to all of the options supplied (redirection is <?>), difference: <?>",
url[:actual], @response_diff)