I keep getting validation errors when running factories due to uniqueness constraints on fields. I am using shoulda with factory_girl. I have a both a unit test and a functional test creating 2 products in the database. I can run 'rake test:units' and 'rake test:functionals' over and over in any order and everything is will be green but when I run 'rake test' which runs the units followed by the functionals I get errors due to uniqueness.
I also tried creating models to break uniqueness in 2 different unit tests and I get the error then as well.
I have been playing with these settings in test_helper.rb but can't get anything to work
class ActiveSupport::TestCase
self.use_transactional_fixtures = true
self.use_instantiated_fixtures = false
end
Does the transactional_fixtures setting take any effect of factories. Whats the best way to handle cleaning the database between tests?