Capybara-selenium fault and redirect example.com/ when without everything is green
Solution is a specific working of Capibara with Rspec.
I add following file to spec/support/database_cleaner.rb
RSpec.configure do |config| config.use_transactional_fixtures = false config.before :each do if Capybara.current_driver == :rack_test DatabaseCleaner.strategy = :transaction else DatabaseCleaner.strategy = :truncation end DatabaseCleaner.start end config.after do DatabaseCleaner.clean endend
Added gem in Gemfile:
group :development, :test do gem 'database_cleaner'end
$> bundle install
And I add a comment to the following line in spec/spec_helper.rb
RSpec.configure do |config| #config.use_transactional_fixtures = trueend
Test becomes green.