Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

A test for irregular ID requirements and custom member action

#2595

This is a follow up for #351 Allow customized regexp for id in map.resources. The underlying issue seems to have been fixed somewhere in 2.3 but I don't see any unit tests for it, so the fix was probably a side-effect.

Including this unit test will stop any future regressions.



  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

Reported by Ruy Asan · May 1st, 2009 @ 09:56 PM

State: committed
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Repository
    Repository
    • State changed from new to committed

    (from [3be3470fab788856b4559742434f195cc6b1009a]) Added routing test for irregular ID requirements and custom member action.

    [#2595 A test for irregular ID requirements and custom member action state:committed]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...

    May 1st, 2009 @ 11:03 PM

  2. Repository
    Repository

    (from [17e712d3a3d3934bb1f694d449d9a76a3ac715c1]) Added routing test for irregular ID requirements and custom member action.

    [#2595 A test for irregular ID requirements and custom member action state:committed]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...

    May 1st, 2009 @ 11:03 PM