aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2010-07-08 15:42:40 +0200
committerPiotr Sarnacki <drogus@gmail.com>2010-09-03 22:59:05 +0200
commiteedbf87d15b99a7cae38b0d8894fc39f1e70a81e (patch)
tree97fe871d6c640c6b83e7956396cd60b0c42b1d67 /actionpack/test
parent177a4bd5b7f903030a100f9b5092b1fa62c7c748 (diff)
downloadrails-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 'actionpack/test')
-rw-r--r--actionpack/test/controller/routing_test.rb2
-rw-r--r--actionpack/test/dispatch/prefix_generation_test.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index 1f14607c31..a8c74a6064 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -251,7 +251,7 @@ class LegacyRouteSetTests < Test::Unit::TestCase
map.pages 'pages', :controller => 'content', :action => 'show_page', :host => 'foo.com'
end
x = setup_for_named_route
- x.expects(:url_for).with(:host => 'foo.com', :only_path => false, :controller => 'content', :action => 'show_page', :use_route => :pages, :router => rs).once
+ x.expects(:url_for).with(:host => 'foo.com', :only_path => false, :controller => 'content', :action => 'show_page', :use_route => :pages).once
x.send(:pages_url)
end
diff --git a/actionpack/test/dispatch/prefix_generation_test.rb b/actionpack/test/dispatch/prefix_generation_test.rb
index efc56c067b..49c5c82ad6 100644
--- a/actionpack/test/dispatch/prefix_generation_test.rb
+++ b/actionpack/test/dispatch/prefix_generation_test.rb
@@ -114,6 +114,7 @@ module TestGenerationPrefix
test "passing :routes to url_for to change current routes" do
env = Rack::MockRequest.env_for("/pure-awesomness/blog/bare_url_for")
env["SCRIPT_NAME"] = "/something"
+ RailsApplication.routes.default_url_options = {:script_name => "/something"}
response = ActionDispatch::Response.new(*RailsApplication.call(env))
assert_equal "/something/generate", response.body
end