Routing errors with Rails 3.0.1 and Rspec 2.0.1

I’m sure something is borked in my app, but I can’t seem to track it
down. A few commits back, my app was fully passing my spec suite. It
was on Rails 3.0.0 and Rspec 2.0.0.beta.20. I’ve now upgraded to
rails 3.0.1 and rspec 2.0.1 Now, I’m getting tons, and I mean tons of
failures that say things like, to take a simple case:

  1. SiteController GET ‘about’ should be successful
    Failure/Error: get ‘about’
    No route matches {:action=>“about”, :controller=>“site”}

    ./spec/controllers/site_controller_spec.rb:21

Here’s the spec:

describe “GET ‘about’” do
it “should be successful” do
get ‘about’
response.should be_success
end
end

And the defined route showing up in rake routes

about GET /
about(.:format)
{:controller=>“site”, :action=>“about”}

This fails if I run rspec by ‘rake routes’ or by ‘bundle exec
autotest’. But, and here’s the weird thing, if I cause autotest to
run that file again, or if I manually run bundle exec rspec spec/
controllers/site_controller_spec.rb, then it passes just fine.

Did I miss something I needed to do in my upgrade? If it matters I’m
using rvm gemsets.

Thanks for any guidance.
Trey

On Oct 19, 2010, at 7:07 PM, Trey wrote:

I’m sure something is borked in my app, but I can’t seem to track it
down.

Me too, and routing as well …

constraints( :subdomain => /.+/ ) do
match ‘/dashboard’ => ‘users#show’
end

it "routes 'http://test.example.com/dashboard' to 

UsersController#dashboard with subdomain ‘test’" do
{ :get => ‘http://test.example.com/dashboard’ }.should route_to(
:controller => ‘users’, :action => ‘show’, :subdomain => ‘test’
)
end

This fails, and unless I’m not crazy a very similar example was made by
David himself some time ago: http://bit.ly/bIK8fA

rails 3.0.1 and rspec 2.0.0 (and rvm too)

Did we miss something ?

ngw

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs