mardi 22 mars 2016

How can I send an ambiguous request in Rails Test Case?

I have the following definitions in my routes:

resources :demands { resources: :solutions }
resources :technologies { resources: :solutions }

and in my controller test, I want to send two requests:

Get /demands/d123/solutions?technology_id=t123
Get /technologies/t123/solutions?demand_id=d123

But they both match the same invokes(in SolutionsControllerTest):

get :index, demand_id: d123, technology_id: t123

it match the first definition in routes.rb, which is

resources :demands { resources: :solutions }

How should I send both requests in distinct methods?

Aucun commentaire:

Enregistrer un commentaire