[rspec-users] undefined method `route_for

Amit Kulkarni lists at ruby-forum.com
Wed Nov 11 08:58:51 EST 2009


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


More information about the rspec-users mailing list