diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-12 15:21:09 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-12 15:21:09 +0000 |
commit | cb8a020ec941101902307b81f4a1a6b9ac6d224d (patch) | |
tree | ca2972ee27b3cb3d9752b3ff296e5fd5178437ee /actionpack/test | |
parent | 8d5d7161eb3817c5469384b94a58eb82d17c0362 (diff) | |
download | rails-cb8a020ec941101902307b81f4a1a6b9ac6d224d.tar.gz rails-cb8a020ec941101902307b81f4a1a6b9ac6d224d.tar.bz2 rails-cb8a020ec941101902307b81f4a1a6b9ac6d224d.zip |
Fixed url rewriter confusion when the controller name was a substring of the controller_prefix
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@397 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/url_test.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/test/controller/url_test.rb b/actionpack/test/controller/url_test.rb index 21575f513a..93c8eb464d 100644 --- a/actionpack/test/controller/url_test.rb +++ b/actionpack/test/controller/url_test.rb @@ -191,7 +191,6 @@ class UrlTest < Test::Unit::TestCase 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 @@ -408,4 +407,13 @@ class UrlTest < Test::Unit::TestCase assert_equal("http://example.com/controller/foo", url.rewrite(:action => 'foo')) end + def test_rewriting_on_similar_fragments + url = ActionController::UrlRewriter.new( + MockRequest.new( + "http://", "example.com", 80, "/advertisements/advert/", + {"controller"=>"advert", "action"=>"index"} + ), "advert", "index" + ) + assert_equal("http://example.com/advertisements/advert/news", url.rewrite(:action => 'news')) + end end |