[rspec-users] undefined method `route_for

Amit Kulkarni lists at ruby-forum.com
Tue Nov 10 07:44:27 EST 2009

Hi all,
I am writing scenarios for testing my routes but it is giving me error
as undefined method `route_for and also for params_from.
Did i miss something which i need to add in my controller

My code is as follows:

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe HomeController, "routes" do
  describe "route generation" do
    it "should map { :controller => 'home', :action => 'index' } to
/home" do
      route_for(:controller => 'home', :action => 'index').should ==

    it "should map { :controller => 'home' } RESTfully" do
      params_from( :get, '/home' ).should == { :controller => 'home',
:action => 'index' }
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list