Say I have a custom route like this…
map.connect ‘item/:id/some_action’, :controller => ‘object’, :action =>
‘change_color’, :conditions => {:method => :put}
I’ve been writing my tests like this…
describe ObjectController
describe “PUT item/:id/some_action” do
[…]
put :change_color, {:id => ‘blue’}
[…]
end
end
So the test doesn’t actually test the url - “item/blue/some_action”, but
rather the underlying Controller/Action that implements it.
Is there a way to write my tests “in terms of” the url - something
like…
describe ObjectController
describe “PUT item/:id/some_action” do
[…]
put “item/blue/some_action”
[…]
end
end
Or are controller tests simply not the place to do this, and I should do
it in Cucumber or something?
Cheers