From 710c5eaf2f7766885d7c8f448de8b3b3ff8929f6 Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Mon, 25 Jul 2011 11:37:25 -0700 Subject: Allow a route to have :format => true When format is true, it is mandatory (as opposed to :format => false). This is currently not possible with resource routes, which automatically make format optional by default. --- actionpack/test/dispatch/mapper_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/mapper_test.rb b/actionpack/test/dispatch/mapper_test.rb index b6c08ffc33..81f0efb76e 100644 --- a/actionpack/test/dispatch/mapper_test.rb +++ b/actionpack/test/dispatch/mapper_test.rb @@ -83,6 +83,13 @@ module ActionDispatch assert_equal '/*path', fakeset.conditions.first[:path_info] assert_nil fakeset.requirements.first[:path] end + + def test_map_wildcard_with_format_true + fakeset = FakeSet.new + mapper = Mapper.new fakeset + mapper.match '/*path', :to => 'pages#show', :format => true + assert_equal '/*path.:format', fakeset.conditions.first[:path_info] + end end end end -- cgit v1.2.3