RSpec 2: NoMethodError on 'route_to' with rspec-rails?

I'm trying to run this test...

require 'spec_helper'

describe HomeController do

  describe 'boilerplate routes' do

    it "should route to '/about'" do
      { :get => "/about" }.should route_to(:controller => 'home', :action => 'show')
    end

  end

end

... and it keeps failing with this error message:

1) HomeController boilerplate routes should route to '/about'
Failure/Error: { :get => "/about" }.should route_to(:controller => 'home', :action => 'show')
   NoMethodError:
      undefined method `route_to' for #
   # ./spec/routes/home_routes_spec.rb:8:in `block (3 levels) in '

I'm using rspec-rails 2.5.0 with rails 3.0.5 & rspec 2.5.1.

I'm doing my code just like it says in the rdocs, trying to follow along with this example code... what am I doing wrong? Help!

12
задан neezer 9 March 2011 в 17:44
поделиться