Added routing test for irregular ID requirements and custom member action.

[#2595 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
This commit is contained in:
Ruy Asan 2009-05-01 13:49:18 -07:00 committed by Jeremy Kemper
parent 99c103be11
commit 3be3470fab
1 changed files with 8 additions and 0 deletions

View File

@ -120,6 +120,14 @@ class ResourcesTest < ActionController::TestCase
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
assert_simply_restful_for :messages, :path_prefix => 'thread/5/', :options => { :thread_id => '5' }