on 2013-03-13 15:16
on 2013-03-14 10:11
Without a single doubt, using factory_girl +database_cleaner gem. Are you using the test framework from rails? or Rspec? here is a good episode http://railscasts.com/episodes/275-how-i-test explaining how to integrate this. and probably ehre talks about database cleaner https://gist.github.com/docwhat/1190475. try to look up yourself some more information. your tests should be as isolated as possible, so your next test shouldnt depend on if the one before fails or passes and what does on the database.
on 2013-03-14 18:47
I run the tests using: $ bundle exec cucumber It is my understanding that cucumber is built on top of rspec. I am also using test/fixtures and not factory_girl. The reason is that I am rewriting a perl terminal interface tool as a web application. The legacy database tables go back 10 years. The data for any scenario is easily extracted from this database and converted into yaml. The typical scenario uses 50-100 rows from 10-30 tables. It would take forever to write all this data as factory_girl ruby code. It is very annoying that I had to resort to using the nil option for the database cleaner, but as I explained, neither transaction nor truncate works.
on 2013-03-15 12:32
So are you still using sqlite3 to run the tests? why didnt the tests see the difference on the database when using MySQL?
on 2013-03-15 16:08
The issue with cucumber, selenium and database transactions is described in: http://stackoverflow.com/questions/7511520/databas... http://www.datatravels.com/technotes/2011/10/01/cu... I also found suggested work-arounds at http://pastie.org/1745020 http://blog.thefrontiergroup.com.au/2009/10/databa... but these do not work for me.