From 309ef1dba01b96d9740bb98e3d52d028bb93fbab Mon Sep 17 00:00:00 2001 From: Ruy Asan Date: Fri, 1 May 2009 13:49:18 -0700 Subject: [PATCH] Added routing test for irregular ID requirements and custom member action. --- actionpack/test/controller/resources_test.rb | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index c807e71..70403fe 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -119,6 +119,14 @@ class ResourcesTest < ActionController::TestCase assert_recognizes(expected_options, :path => 'thread/1.1.1/messages/1', :method => :get) end end + + def test_irregular_id_requirements_should_get_passed_to_member_actions + expected_options = {:controller => 'messages', :action => 'custom', :id => '1.1.1'} + + with_restful_routing(:messages, :member => {:custom => :get}, :requirements => {:id => /[0-9]\.[0-9]\.[0-9]/}) do + assert_recognizes(expected_options, :path => 'messages/1.1.1/custom', :method => :get) + end + end def test_with_path_prefix with_restful_routing :messages, :path_prefix => '/thread/:thread_id' do -- 1.6.0.1