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
But I don’t know how to make rspec play pretend and say the routes are
there.
Routes and spec:
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