I encountered a similar error, except that I saw a problem when running @javascript scripts.
After long searches, reading and pulling hair, I came across this post
I looked in the hook_cleaner hook file mentioned there ( cucumber-rails-0.4.0 / lib / cucumber / rails / hooks / database_cleaner.rb ), and lo-and-behold sets the cleaner database strategy for: truncate without exception before each script with the following tags: @ no-txn, @selenium, @culerity, @celerity, @javascript.
Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do DatabaseCleaner.strategy = :truncation end
I copied and pasted the previous statement into my env.rb cucumber file and added my: except statement to it. This seems to fix the problem.
Are you sure these are not your @javascript scripts that are causing the problem?
source share