Undefined method `route_for

Thanks David.
Also i am little bit confused regarding routes.

Consider a routing example

it “should map { :controller => ‘channels’, :action => ‘new’ } to
/channels/new” do
route_for(:controller => “channels”, :action => “new”).should ==
“/channels/new”
end

Now i can see all the routing methods by rake routes.In that i can see
this new action defined.

Now imagine if i write an action which is not defined in the rake routes
then instead of failing it is passing.For e.g.

it “should map { :controller => ‘channels’, :action => ‘test’ } to
/channels/test” do
route_for(:controller => “channels”, :action => “test”).should ==
“/channels/test”
end

Now here ‘test’ action is not defined in the routes.So it should fail
but it isn’t.
May be i am missing something here.

Yes,Thanks a lot Andrew.
The last two lines were not commented in routes.rb
because of that it was matching default.Now i commented out those line
and it was catching if undefined routes are given.

2009/12/14 Amit K. [email protected]

end

Now here ‘test’ action is not defined in the routes.So it should fail
but it isn’t.
May be i am missing something here.

Are you sure you have the default last two lines commented out in
routes.rb.
If you haven’t they will match that action - I think.

All best

Andrew