##Configure your JavaScript tests to use truncation instead of transactions:
DatabaseCleaner.strategy = :truncation
###Longer explanation:
The transaction strategy doesn't work well with JavaScript tests, because most JavaScript-capable capybara drivers run the tests in a different thread than the application code.