[rspec-users] undefined method `route_for

Amit Kulkarni lists at ruby-forum.com
Mon Dec 14 02:18:17 EST 2009


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.
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list