[rspec-users] specing dynamic routes
Tye Shavik
tyeshavik at gmail.com
Sun Feb 3 16:12:35 EST 2008
Hi,
I dynamically generating routes and I'm running into trouble specing
due to isolation.
I need to know if there is a way to mock routes, I tried but not sure
how to approach it.
Let me describe what I'm attempting to do:
I have many nodes of different category types eg. polls, pictures, videos
So whenever a new category is added there should be named routes for it.
The code part works fine, the routes are being generated
http://pastie.org/147021
But I don't know how to make rspec play pretend and say the routes are there.
Routes and spec:
http://pastie.org/147018
Error:
'NodesController#route_for should map { :controller => 'nodes',
:action => 'index' } to /discussions' FAILED
expected: "/discussions",
got: "/nodes?node_category=discussions" (using ==)
Thanks for any assistance
More information about the rspec-users
mailing list