Skip to content

routes test with a id is not worked. #602

Closed
@zw963

Description

spec is following:

it { should route(:get, '/api/v1/promotions/1').to(:controller => 'promotin/commons', :action => :show, id: 1) }

test failed with:

Promotion::CommonsController should route GET /api/v1/promotions/1 to/from {:controller=>"promotin/commons", :action=>"show", :id=>"1"}
     Failure/Error: it { should route(:get, '/api/v1/promotions/1').to(:controller => 'promotin/commons', :action => :show, id: 1) }
       The recognized options <{"action"=>"show", "controller"=>"promotion/commons", "id"=>"1"}> did not match <{"controller"=>"promotin/commons", "action"=>"show", "id"=>"1"}>, difference:.
       --- expected
       +++ actual
       @@ -1 +1 @@
       -{"controller"=>"promotin/commons", "action"=>"show", "id"=>"1"}
       +{"action"=>"show", "controller"=>"promotion/commons", "id"=>"1"}

spec no :id args is worked.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions