From 904df818d61b695a5f9508864137d13fffa22d15 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Wed, 3 Oct 2007 05:47:41 +0000 Subject: Move ActionController::Routing.optimise_named_routes to ActionController::Base.optimise_named_routes. Now you can set it in the config. ActionController::Routing::DynamicSegment#interpolation_chunk should call #to_s on all values before calling URI.escape. [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7724 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/routing_test.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'actionpack/test/controller/routing_test.rb') diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index ac92af7163..2522b2398b 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -48,7 +48,7 @@ class LegacyRouteSetTests < Test::Unit::TestCase attr_reader :rs def setup # These tests assume optimisation is on, so re-enable it. - ActionController::Routing.optimise_named_routes = true + ActionController::Base.optimise_named_routes = true @rs = ::ActionController::Routing::RouteSet.new @rs.draw {|m| m.connect ':controller/:action/:id' } @@ -852,6 +852,11 @@ class DynamicSegmentTest < Test::Unit::TestCase assert_equal a_value, eval(%("#{segment.interpolation_chunk}")) end + def test_interpolation_chunk_should_accept_nil + a_value = nil + assert_equal '', eval(%("#{segment.interpolation_chunk('a_value')}")) + end + def test_value_regexp_should_be_nil_without_regexp assert_equal nil, segment.value_regexp end -- cgit v1.2.3