I have a problem with JS query specifications - the main visit to the model edit page:
it "can edit a doc", :js => true do
doc = FactoryGirl.create(:doc)
puts Doc.find(doc.id)
visit edit_doc_path(doc)
end
Result: "ActiveRecord :: RecordNotFound - Could not find doc with id = 1"
It is strange that this works with the standard query specification. I tried both webkit drivers and selenium. My spec_helper looks like this (should be pretty standard):
RSpec.configure do |config|
config.use_transactional_fixtures = false
Capybara.javascript_driver = :webkit
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
config.before(:each, :type => :request) do
Capybara.reset_sessions!
end
end
Rails 3.1.4, no versions for test libraries capybara, rspec, etc.
Any input is much appreciated! Thank!
source
share