Rails 3 + latest rspec 2: route set not finalized

Hey guys,

i have a problem with latest rails 3 and rspec2.0.0.12beta.
When running most of my (with rails 2 and rspec 1 working) controller
specs i get:

route set not finalized

I reduced the problem to the max:

$ cat config/routes.rb
Foo::Application.routes.draw do |map|
resources :profiles
end

$ cat spec/controllers/profiles_controller_spec.rb

require ‘spec_helper’
describe ProfilesController do
describe ‘GET index’ do
it ‘should render the index template’ do
get ‘index’
response.should render_template(:index)
end
end
end

-> The spec-run:

$ bundle exec spec spec/controllers/profiles_controller_spec.rb

F

  1. ProfilesController GET index should render the index template
    Failure/Error: get ‘index’
    route set not finalized

    ~/.bundle/ruby/1.8/gems/rack-mount-0.6.6/lib/rack/mount/

route_set.rb:208:in generate' # ~/.bundle/ruby/1.8/gems/rspec-rails-2.0.0.beta.8/lib/rspec/rails/ monkey/action_controller/test_case.rb:111:inprocess’
# ~/.bundle/ruby/1.8/gems/rspec-rails-2.0.0.beta.8/lib/rspec/rails/
monkey/action_controller/test_case.rb:59:in `get’
# ./spec/controllers/profiles_controller_spec.rb:7

Finished in 0.04356 seconds
1 example, 1 failures

I do realize that the error comes from rack-mount, not rspec itself.
However, the application itself
is working as expected, so it has to be something specific about the
way rspec and rack-mount interact.

The relevant part of the Gemfile:

gem ‘rspec’, :git => ‘git://github.com/dchelimsky/rspec.git’
gem ‘rspec-rails’, :git => ‘git://github.com/dchelimsky/rspec-
rails.git’

$ rails -v
Rails 3.0.0.beta4
Os: Ubuntu Lucid

Any ideas?

On Jun 22, 2010, at 3:29 AM, Timo Rößner wrote:

$ cat config/routes.rb
get ‘index’

gem ‘rspec’, :git => ‘git://github.com/dchelimsky/rspec.git’
gem ‘rspec-rails’, :git => ‘git://github.com/dchelimsky/rspec-rails.git’
$ rails -v
Rails 3.0.0.beta4
Os: Ubuntu Lucid

Any ideas?

The gemfile points to github, but the backtrace above shows
rspec-rails-2.0.0.beta.8 installed. Not sure why there is a conflict.
Have you run bundle update lately?

Hey,

it turns out that the culprit was neither rspec nor rails but haml
3.0.11 (seriously).

I can reproduce the problem easily:

  • Set haml-gem to 3.0.11, run “bundle install” -> there is the
    problem.
  • Set haml-gem to 3.0.10, run “bundle install” -> everything is ok.

The error message was - uhm - misleading at best…:slight_smile:

I will create a corresponding issue in the haml-group,

Cheers.