From 177ed3e6816bb655a0aca6a99df5a456efd96e10 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 2 Jul 2005 18:16:38 +0000 Subject: Added more tests on assert_redirected_to #1581 [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1609 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/assertions.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/assertions.rb b/actionpack/lib/action_controller/assertions.rb index c8245c7a3a..64b47c94da 100644 --- a/actionpack/lib/action_controller/assertions.rb +++ b/actionpack/lib/action_controller/assertions.rb @@ -56,11 +56,10 @@ module Test #:nodoc: # such at assert_redirected_to(:controller => "weblog") will also match the redirection of # redirect_to(:controller => "weblog", :action => "show") and so on. def assert_redirected_to(options = {}, message=nil) - assert_redirect(message) + assert_response(:redirect, message) if options.is_a?(String) msg = build_message(message, "expected a redirect to , found one to ", options, @response.redirect_url) - url_regexp = %r{^(\w+://.*?(/|$|\?))(.*)$} eurl, epath, url, path = [options, @response.redirect_url].collect do |url| u, p = (url_regexp =~ url) ? [$1, $3] : [nil, url] -- cgit v1.2.3