aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-13 11:35:48 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-13 11:35:48 +0000
commit922f817a5a369adc8cb0dd53f332785ee20a667a (patch)
tree8a0cf0b51e59e9fe35a12938a198b436ecc65212 /actionpack/test
parent0cce17f811a7e5217e667b40c44f788e3559f790 (diff)
downloadrails-922f817a5a369adc8cb0dd53f332785ee20a667a.tar.gz
rails-922f817a5a369adc8cb0dd53f332785ee20a667a.tar.bz2
rails-922f817a5a369adc8cb0dd53f332785ee20a667a.zip
Added the option of passing false to :module or :controller_prefix in order to "break out" of a module or prefix
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@142 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/url_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_test.rb b/actionpack/test/controller/url_test.rb
index bf6a7aab75..10577382a6 100644
--- a/actionpack/test/controller/url_test.rb
+++ b/actionpack/test/controller/url_test.rb
@@ -22,6 +22,14 @@ class UrlTest < Test::Unit::TestCase
{ "type" => "ISBN", "code" => "0743536703" }
), "books", "show")
+ @library_url_using_module = ActionController::UrlRewriter.new(MockRequest.new(
+ "http://",
+ "www.singlefile.com",
+ 80,
+ "/library/books/ISBN/0743536703/show",
+ { "type" => "ISBN", "code" => "0743536703", "module" => "library" }
+ ), "books", "show")
+
@library_url_on_index = ActionController::UrlRewriter.new(MockRequest.new(
"http://",
"www.singlefile.com",
@@ -102,6 +110,10 @@ class UrlTest < Test::Unit::TestCase
def test_clean_controller_with_module
assert_equal "http://www.singlefile.com/shop/purchases/", @library_url.rewrite(:module => "shop", :controller => "purchases")
end
+
+ def test_getting_out_of_a_module
+ assert_equal "http://www.singlefile.com/purchases/", @library_url_using_module.rewrite(:module => false, :controller => "purchases")
+ end
def test_controller_and_action
assert_equal "http://www.singlefile.com/library/settings/show", @library_url.rewrite(:controller => "settings", :action => "show")