aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-03-04 22:17:25 -0800
committerCarl Lerche <carllerche@mac.com>2010-03-04 22:17:25 -0800
commit57cf1c578a5a3823ae280cf786c1d2ec71001ba8 (patch)
tree7c06fa5dd466edf11ddf157d1cb3901d71edf1ea
parent9a17416d8bda0df0a6961e547c3cf1d677e66b5e (diff)
downloadrails-57cf1c578a5a3823ae280cf786c1d2ec71001ba8.tar.gz
rails-57cf1c578a5a3823ae280cf786c1d2ec71001ba8.tar.bz2
rails-57cf1c578a5a3823ae280cf786c1d2ec71001ba8.zip
Remove the ability to set the mountpoint when initializing a route set.
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb7
-rw-r--r--actionpack/test/dispatch/url_generation_test.rb28
2 files changed, 7 insertions, 28 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index a53d8067dd..5c246d8781 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -209,19 +209,18 @@ module ActionDispatch
end
end
- attr_accessor :routes, :named_routes, :mount_point
+ attr_accessor :routes, :named_routes
attr_accessor :disable_clear_and_finalize, :resources_path_names
def self.default_resources_path_names
{ :new => 'new', :edit => 'edit' }
end
- def initialize(options = {})
+ def initialize
self.routes = []
self.named_routes = NamedRouteCollection.new
self.resources_path_names = self.class.default_resources_path_names.dup
self.controller_namespaces = Set.new
- self.mount_point = options[:mount_point]
@disable_clear_and_finalize = false
clear!
@@ -339,7 +338,7 @@ module ActionDispatch
def generate(options, recall = {}, method = :generate)
options, recall = options.dup, recall.dup
- script_name = options.delete(:script_name) || mount_point
+ script_name = options.delete(:script_name)
named_route = options.delete(:use_route)
options = options_as_params(options)
diff --git a/actionpack/test/dispatch/url_generation_test.rb b/actionpack/test/dispatch/url_generation_test.rb
index b55e001fa7..18b5b7ee00 100644
--- a/actionpack/test/dispatch/url_generation_test.rb
+++ b/actionpack/test/dispatch/url_generation_test.rb
@@ -1,28 +1,8 @@
require 'abstract_unit'
module TestUrlGeneration
- class WithoutMountpoint < ActiveSupport::TestCase
- setup do
- app = lambda { |env| [200, {}, "Hello"] }
- @router = ActionDispatch::Routing::RouteSet.new
- @router.draw do
- match "/foo", :to => app, :as => :foo
- end
-
- singleton_class.send(:include, @router.url_helpers)
- end
-
- test "generating URLS normally" do
- assert_equal "/foo", foo_path
- end
-
- test "accepting a :script_name option" do
- assert_equal "/bar/foo", foo_path(:script_name => "/bar")
- end
- end
-
class WithMountPoint < ActionDispatch::IntegrationTest
- Router = ActionDispatch::Routing::RouteSet.new(:mount_point => "/baz")
+ Router = ActionDispatch::Routing::RouteSet.new
Router.draw { match "/foo", :to => "my_route_generating#index", :as => :foo }
class ::MyRouteGeneratingController < ActionController::Base
@@ -42,11 +22,11 @@ module TestUrlGeneration
Router
end
- test "using the default :script_name option" do
- assert_equal "/baz/foo", foo_path
+ test "generating URLS normally" do
+ assert_equal "/foo", foo_path
end
- test "overriding the default :script_name option" do
+ test "accepting a :script_name option" do
assert_equal "/bar/foo", foo_path(:script_name => "/bar")
end