Rails 2.1.1
Among other things, a security fix.
This commit is contained in:
parent
d2c4c8737c
commit
d4f97345db
354 changed files with 21027 additions and 3072 deletions
|
@ -1983,6 +1983,26 @@ class RouteSetTest < Test::Unit::TestCase
|
|||
Object.send(:remove_const, :Api)
|
||||
end
|
||||
|
||||
def test_namespace_with_path_prefix
|
||||
Object.const_set(:Api, Module.new { |m| m.const_set(:ProductsController, Class.new) })
|
||||
|
||||
set.draw do |map|
|
||||
|
||||
map.namespace 'api', :path_prefix => 'prefix' do |api|
|
||||
api.route 'inventory', :controller => "products", :action => 'inventory'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
request.path = "/prefix/inventory"
|
||||
request.method = :get
|
||||
assert_nothing_raised { set.recognize(request) }
|
||||
assert_equal("api/products", request.path_parameters[:controller])
|
||||
assert_equal("inventory", request.path_parameters[:action])
|
||||
ensure
|
||||
Object.send(:remove_const, :Api)
|
||||
end
|
||||
|
||||
def test_generate_finds_best_fit
|
||||
set.draw do |map|
|
||||
map.connect "/people", :controller => "people", :action => "index"
|
||||
|
@ -2392,10 +2412,10 @@ uses_mocha 'route loading' do
|
|||
end
|
||||
|
||||
def test_adding_inflections_forces_reload
|
||||
Inflector::Inflections.instance.expects(:uncountable).with('equipment')
|
||||
ActiveSupport::Inflector::Inflections.instance.expects(:uncountable).with('equipment')
|
||||
routes.expects(:reload!)
|
||||
|
||||
Inflector.inflections { |inflect| inflect.uncountable('equipment') }
|
||||
ActiveSupport::Inflector.inflections { |inflect| inflect.uncountable('equipment') }
|
||||
end
|
||||
|
||||
def test_load_with_configuration
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue