hi there, I had some problems with factory_girl, actual versions syntax is a bit different (Link). This factories.rb accomplished the same job (as in the screencast):
I'm also using database_cleaner to get my db into a clean state for the tests (Link), because some of the changes to the database weren't rolled back after the tests when using factory_girl and I got failures in further test-runs (I needed version 1.0.1, because 1.1.1 generates a bug if using sqlite-db Link).
Adding this line to my Gemfile under the test group definition does the fix:
ruby
gem "database_cleaner", '1.0.1'
Database_cleaner is quite easy to setup and seems to work pretty neat.
Maybe someone runs into the same problems, it took me quite a bit of googling to get everything together with the current sw-versions, so I thought I'd post it here. Cheers!
hi there, I had some problems with factory_girl, actual versions syntax is a bit different (Link). This factories.rb accomplished the same job (as in the screencast):
you can create a user in your specs with:
I'm also using database_cleaner to get my db into a clean state for the tests (Link), because some of the changes to the database weren't rolled back after the tests when using factory_girl and I got failures in further test-runs (I needed version 1.0.1, because 1.1.1 generates a bug if using sqlite-db Link).
Adding this line to my Gemfile under the test group definition does the fix:
Database_cleaner is quite easy to setup and seems to work pretty neat.
Maybe someone runs into the same problems, it took me quite a bit of googling to get everything together with the current sw-versions, so I thought I'd post it here. Cheers!