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.*
The project is online https://github.com/rubyclerks/office_clerk and i am
not sure what information to include here: ruby 2.0 on mac. rails 4.0.11 ,
rspec 3.1.0 , factory_girl _rails 4.5.0.
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
*
https://github.com/rubyclerks/office_clerk/blob/master/spec/factories/baskets.rb
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
spec_helper:
https://github.com/rubyclerks/office_clerk/blob/master/spec/spec_helper.rb
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/325f1136-3968-46f6-96e9-c7605e79077b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.