aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorSven Fuchs <svenfuchs@artweb-design.de>2008-05-13 22:04:20 +0200
committerPratik Naik <pratiknaik@gmail.com>2008-05-16 17:36:09 +0100
commit345f030c5b6c0a28ddde56c80a1112b00d345c79 (patch)
tree710430c54edfa4c1f145fdad150ea184fc2cc0d1 /actionpack/test/controller
parent77f873acf2f1fb4533dfca6b26b965a115ebbc54 (diff)
downloadrails-345f030c5b6c0a28ddde56c80a1112b00d345c79.tar.gz
rails-345f030c5b6c0a28ddde56c80a1112b00d345c79.tar.bz2
rails-345f030c5b6c0a28ddde56c80a1112b00d345c79.zip
Ensure routing generator works with non-string keys. [#172 state:resolved]
Make sure that (with recent correction to globbed parameter escaping) non-string values can still be passed route generation helpers for globbed route segments. For example, foo_path([1, 2, 3]) should still work for a route like map.foo "*globbed" by implicitely calling to_s on the Fixnums. Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/routing_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index b28f7bcdff..5e5503fd52 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -50,6 +50,13 @@ class UriReservedCharactersRoutingTest < Test::Unit::TestCase
:additional => ["add#{@segment}itional-1", "add#{@segment}itional-2"] }
assert_equal options, @set.recognize_path("/controller/act#{@escaped}ion/var#{@escaped}iable/add#{@escaped}itional-1/add#{@escaped}itional-2")
end
+
+ def test_route_generation_allows_passing_non_string_values_to_generated_helper
+ assert_equal "/controller/action/variable/1/2", @set.generate(:controller => "controller",
+ :action => "action",
+ :variable => "variable",
+ :additional => [1, 2])
+ end
end
class LegacyRouteSetTests < Test::Unit::TestCase