diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-07-08 15:42:40 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-03 22:59:05 +0200 |
commit | eedbf87d15b99a7cae38b0d8894fc39f1e70a81e (patch) | |
tree | 97fe871d6c640c6b83e7956396cd60b0c42b1d67 /railties/test | |
parent | 177a4bd5b7f903030a100f9b5092b1fa62c7c748 (diff) | |
download | rails-eedbf87d15b99a7cae38b0d8894fc39f1e70a81e.tar.gz rails-eedbf87d15b99a7cae38b0d8894fc39f1e70a81e.tar.bz2 rails-eedbf87d15b99a7cae38b0d8894fc39f1e70a81e.zip |
New way of generating urls for Application from Engine.
It's based specifying application's script_name with:
Rails.application.default_url_options = {:script_name => "/foo"}
default_url_options method is delegated to routes. If router
used to generate url differs from the router passed via env
it always overwrites :script_name with this value.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/railties/mounted_engine_routes_test.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/railties/test/railties/mounted_engine_routes_test.rb b/railties/test/railties/mounted_engine_routes_test.rb index fe598b58b1..18789ab9e3 100644 --- a/railties/test/railties/mounted_engine_routes_test.rb +++ b/railties/test/railties/mounted_engine_routes_test.rb @@ -99,6 +99,9 @@ module ApplicationTests # test generating application's route from engine get "/someone/blog/generate_application_route" assert_equal "/", last_response.body + + # with script_name + Rails.application.default_url_options = {:script_name => "/foo"} get "/someone/blog/generate_application_route", {}, "SCRIPT_NAME" => "/foo" assert_equal "/foo/", last_response.body end |