Thursday, 27 August 2009

Testing routes

Here is a little tip

have the following in my routes.rb file

map.resources :jobs do |job|
job.resources :pdfs
end


functional test was failing
Couldn't find Job without an ID

So add this to the functional test

get :show, :id =>@pdf, :job_id => @job.id

Passing the job_id puts it in the parameters hash, but not inside the array for the object.

No comments:

Post a Comment