diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-24 13:50:58 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-24 13:50:58 +0000 |
commit | 80b656637a29ce827b10923bb357cd56cde9b15f (patch) | |
tree | 75ac0ae41aca15c2bbed579fa066923722e329b3 /actionpack/test/controller/url_test.rb | |
parent | 45db66de56d4f5c4cd83aba782015d5ce752f3a2 (diff) | |
download | rails-80b656637a29ce827b10923bb357cd56cde9b15f.tar.gz rails-80b656637a29ce827b10923bb357cd56cde9b15f.tar.bz2 rails-80b656637a29ce827b10923bb357cd56cde9b15f.zip |
Added :application_prefix to url_for and friends that makes it easier to setup Rails in non-vhost environments #516 [Jamis Buck]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@494 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/url_test.rb')
-rw-r--r-- | actionpack/test/controller/url_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_test.rb b/actionpack/test/controller/url_test.rb index 8315830776..f7f08a2fe5 100644 --- a/actionpack/test/controller/url_test.rb +++ b/actionpack/test/controller/url_test.rb @@ -453,4 +453,25 @@ class UrlTest < Test::Unit::TestCase url.rewrite({ :controller => "msg", :action_prefix => "allous", :action => "new" }) ) end + + def test_clean_application_prefix + assert_equal "http://www.singlefile.com/namespace/library/books/ISBN/0743536703/show", + @library_url.rewrite(:application_prefix => "/namespace") + end + + def test_clean_application_prefix_with_controller_prefix + assert_equal "http://www.singlefile.com/namespace/shop/", + @library_url.rewrite(:application_prefix => "/namespace", + :controller_prefix => "shop" ) + end + + def test_blank_application_prefix + assert_equal "http://www.singlefile.com/library/books/ISBN/0743536703/show", + @library_url.rewrite(:application_prefix => "") + end + + def test_nil_application_prefix + assert_equal "http://www.singlefile.com/library/books/ISBN/0743536703/show", + @library_url.rewrite(:application_prefix => nil) + end end |