0

I'm a newbie in Ruby on Rails. I just started with the RoR Tutorial from Michael Hartl (klick). I'm at 5.2.1 where we learn about Integration_tests.

When I run rails generate integration_test layout_links it generates rspec files but when running rspec spec I get:

You have already activated rspec-core 2.6.3, but your Gemfile requires rspec-core 2.x.x and all tests fail.

and if I play around a little I get SystemStackError:stack level too deep and all tests fail.

Probably my Gemsets are messed up or I need another version of rspec-rails running.

Part of my Gemfile.lock looks like:

rake (0.9.1)
rb-fsevent (0.4.0)
rspec (2.6.0)
  rspec-core (~> 2.6.0)
  rspec-expectations (~> 2.6.0)
  rspec-mocks (~> 2.6.0)
rspec-core (2.6.3)
rspec-expectations (2.6.0)
  diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
rspec-rails (2.0.0.beta.18)
  rspec (>= 2.0.0.beta.14)
  webrat (>= 0.7.0)
sqlite3 (1.3.3)
thor (0.14.6)

EDIT: Solved. I changed the rspec-rails version to 2.6.1 and added 'webrat' to :development and :test gem sets. Works like a charm... :-)

0

1 Answer 1

3

This can usually be fixed by doing bundle exec rspec spec instead of just rspec spec

Sign up to request clarification or add additional context in comments.

2 Comments

Or you could bundle install --binstubs and just run bin/rspec spec, which is basically a shorter way of writing bundle exec rspec.
Useless. Even passing tests don't pass anymore. With bundle exec rspec spec I get: PagesController GET 'home' should be successful Failure/Error: response.should be_success NoMethodError: undefined method 'last_response' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x000001038df5f0> # ./spec/controllers/pages_controller_spec.rb:13:in 'block (3 levels) in <top (required)>'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.