From 2269c23699968d31f2f81052ebcf7fcc29e82502 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 27 Jun 2005 05:36:03 +0000 Subject: 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 --- actionpack/lib/action_controller/assertions.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_controller/assertions.rb') 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 -- cgit v1.2.3