aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-03-04 14:37:59 -0600
committerJoshua Peek <josh@joshpeek.com>2009-03-04 14:37:59 -0600
commit638b3b15a13c4e274cfb317c40248e9feea3bfae (patch)
tree789772b55b67e7dcb70a5dfa2c14d3f64f83734f /actionpack/test/controller
parent6087fe8eedf0249f74be10721714f5298286b198 (diff)
downloadrails-638b3b15a13c4e274cfb317c40248e9feea3bfae.tar.gz
rails-638b3b15a13c4e274cfb317c40248e9feea3bfae.tar.bz2
rails-638b3b15a13c4e274cfb317c40248e9feea3bfae.zip
Generating routes with optional format segment does not inherit params format [#2043 state:resolved]
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/routing_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index 13ba0c30dd..01b3db64fc 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -2237,6 +2237,22 @@ class RouteSetTest < Test::Unit::TestCase
)
end
+ def test_format_is_not_inherit
+ set.draw do |map|
+ map.connect '/posts.:format', :controller => 'posts'
+ end
+
+ assert_equal '/posts', set.generate(
+ {:controller => 'posts'},
+ {:controller => 'posts', :action => 'index', :format => 'xml'}
+ )
+
+ assert_equal '/posts.xml', set.generate(
+ {:controller => 'posts', :format => 'xml'},
+ {:controller => 'posts', :action => 'index', :format => 'xml'}
+ )
+ end
+
def test_expiry_determination_should_consider_values_with_to_param
set.draw { |map| map.connect 'projects/:project_id/:controller/:action' }
assert_equal '/projects/1/post/show', set.generate(