aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-01-02 20:10:11 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-01-02 20:10:11 +0000
commit3e7a4ecc57da31c908982f933de65d33ebbfc344 (patch)
tree92e7667f726b4755e61a87d99f08b3c4053bf1fa /actionpack/test/controller
parent1f6c4aca28c5514e5d1b96b6372398aba76a3776 (diff)
downloadrails-3e7a4ecc57da31c908982f933de65d33ebbfc344.tar.gz
rails-3e7a4ecc57da31c908982f933de65d33ebbfc344.tar.bz2
rails-3e7a4ecc57da31c908982f933de65d33ebbfc344.zip
Fixed redirects when the controller and action is named the same. Still haven't fixed same controller, module, and action, though #201 [Josh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@321 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/url_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_test.rb b/actionpack/test/controller/url_test.rb
index 5cae4e289b..21575f513a 100644
--- a/actionpack/test/controller/url_test.rb
+++ b/actionpack/test/controller/url_test.rb
@@ -51,6 +51,14 @@ class UrlTest < Test::Unit::TestCase
"http://", "www.singlefile.com", 80, "/identity/show/5", { "id" => "5" }
), "identity", "show")
+ @clean_url_with_same_action_and_controller_name = ActionController::UrlRewriter.new(MockRequest.new(
+ "http://", "www.singlefile.com", 80, "/login/login", { }
+ ), "login", "login")
+
+ @clean_url_with_same_action_and_controller_and_module_name = ActionController::UrlRewriter.new(MockRequest.new(
+ "http://", "www.singlefile.com", 80, "/login/login/login", { "module" => "login" }
+ ), "login", "login")
+
@clean_url_with_id_as_char = ActionController::UrlRewriter.new(MockRequest.new(
"http://", "www.singlefile.com", 80, "/teachers/show/t", { "id" => "t" }
), "teachers", "show")
@@ -179,6 +187,15 @@ class UrlTest < Test::Unit::TestCase
assert_equal "http://www.singlefile.com/library/settings/", @library_url.rewrite(:controller => "settings", :action => "index")
end
+ def test_same_controller_and_action_names
+ assert_equal "http://www.singlefile.com/login/logout", @clean_url_with_same_action_and_controller_name.rewrite(:action => "logout")
+ end
+
+ # FIXME
+ def xtest_same_module_and_controller_and_action_names
+ assert_equal "http://www.singlefile.com/login/login/logout", @clean_url_with_same_action_and_controller_and_module_name.rewrite(:action => "logout")
+ end
+
def test_controller_and_action_with_same_name_as_controller
@clean_urls.each do |url|
assert_equal "http://www.singlefile.com/anything/identity", url.rewrite(:controller => "anything", :action => "identity")