1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Don't use use_controllers in routing tests

This commit is contained in:
Joshua Peek 2009-10-18 00:26:36 -05:00
parent 2c3ca9ae80
commit 6873b1d658

View file

@ -22,7 +22,6 @@ end
# See RFC 3986, section 3.3 for allowed path characters.
class UriReservedCharactersRoutingTest < Test::Unit::TestCase
def setup
ActionController::Routing.use_controllers! ['controller']
@set = ActionController::Routing::RouteSet.new
@set.draw do |map|
map.connect ':controller/:action/:variable/*additional'
@ -36,8 +35,9 @@ class UriReservedCharactersRoutingTest < Test::Unit::TestCase
end
def test_route_generation_escapes_unsafe_path_characters
assert_equal "/contr#{@segment}oller/act#{@escaped}ion/var#{@escaped}iable/add#{@escaped}itional-1/add#{@escaped}itional-2",
@set.generate(:controller => "contr#{@segment}oller",
@set.generate(:controller => "content", :action => "act#{@segment}ion", :variable => "variable", :additional => "foo")
assert_equal "/content/act#{@escaped}ion/var#{@escaped}iable/add#{@escaped}itional-1/add#{@escaped}itional-2",
@set.generate(:controller => "content",
:action => "act#{@segment}ion",
:variable => "var#{@segment}iable",
:additional => ["add#{@segment}itional-1", "add#{@segment}itional-2"])
@ -52,7 +52,7 @@ class UriReservedCharactersRoutingTest < Test::Unit::TestCase
end
def test_route_generation_allows_passing_non_string_values_to_generated_helper
assert_equal "/controller/action/variable/1/2", @set.generate(:controller => "controller",
assert_equal "/content/action/variable/1/2", @set.generate(:controller => "content",
:action => "action",
:variable => "variable",
:additional => [1, 2])