#481 new


Reported by Jarrod | January 15th, 2011 @ 07:15 PM

I setup a "spec/routes" folder in my Rails app as described in section 18.8.4 Specifying Routes. Inside that folder I placed one file called "client_routes_spec.rb", the contents of which follow:

require 'spec_helper'
describe "Client resource routing" do
  it "routes /clients to clients#index" do
    {:get => "/clients"}.should route_to({:controller => "clients", :action => "index"})

When I run this test, I get an exception that "route_to" is an undefined method. Moving the file to the "spec/controllers" directory resolves the problem.

I wasn't able to find any documentation on the RSpec site pertaining to a "spec/routes" folder. Is this a mistake in the book or a defect in RSpec?

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket