Skip to content

Commit

Permalink
Added routing test for irregular ID requirements and custom member ac…
Browse files Browse the repository at this point in the history
…tion.

[#2595 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
clarabstract authored and jeremy committed May 1, 2009
1 parent 93c5578 commit 17e712d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions actionpack/test/controller/resources_test.rb
Expand Up @@ -120,6 +120,14 @@ def test_with_path_prefix_requirements
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' }
Expand Down

0 comments on commit 17e712d

Please sign in to comment.