As per subject, i am getting Errors now and then. Often on a whole run (all 212 tests) all is good. Sometimes not. Always when i run just one of some tests, as happens with guard. It's always
ActiveRecord::StatementInvalid:
SQLite3::ConstraintException: PRIMARY KEY must be unique
but on 3 different objects (that all use Basket)
Now i am quite new new to rspec, and though i do like it, i can't say i begin to understand the innards.
I have datacleaner installed, but the same happens without. I guess both use transactions and as seen above with sqlite (problem?)
I use FactoryGirl (which i is also new for me) to create objects with associated objects, and those are the problem.*
Any help appreciated. Even if its just a direction or some good docs. I have been googling and banging my head but in vain
Torsten
factory :basket do
sequence(:id)
factory :basket_with_item do
items {build_list :item , 1 }
end
factory :basket_2_items do
items {[FactoryGirl.create(:item2) , FactoryGirl.create(:item22)]}
end