[rspec-users] undefined method `route_for

David Chelimsky dchelimsky at gmail.com
Wed Nov 11 10:43:06 EST 2009


On Nov 11, 2009, at 5:58 AM, Amit Kulkarni <lists at ruby-forum.com> wrote:

> Hi David still no success.
> 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 ==
> '/home'
>    end
>
>    it "should map { :controller => 'home' } RESTfully" do
>      params_from( :get, '/home' ).should == { :controller => 'home',
> :action => 'index' }
>    end
>  end
> end
>
> I am using "spec home_controller_spec.rb" by going under
> spec/controllers/ directory.

Don't do that :)

Go to the project root directory and say "spec spec/controllers/ 
home_controller_spec.rb"

> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users


More information about the rspec-users mailing list