I have an application that I'm testing with rspec2 (2.6.4), capybara and selenium.
When I run any request spec directly with rspec, the test passes.
When I run the request specs with autotest they all fail with a message saying 'Cannot find a User with ID= **.
When autotest reloads the first request test automatically, it passes
Autotest then reloads all tests and when it reaches the request tests they all fail again
Users are being created by factory-girl and logged in using devise as follows:
before(:each) do
@user = Factory(:user)
login_as @user
end
after(:each){
logout
}
and in the spec helper I have
def login(user)
post login_path, :login => user.login, :password => 'testing'
end
These are the relevant gems i have installed (group :test)
gem "rspec"
gem "rspec-rails"
gem "autotest-rails"
gem "selenium-webdriver", ">= 0.2.2"
gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git'
gem 'launchy'
gem 'database_cleaner'
This has been baffling me for a while now - any thoughts anyone? Even any thoughts on how to start looking at the stack trace to see where the two calls are differing?
autotest
failing to load yourspec_helper.rb
? – Ray Baxter