Hi Antonio,
thanks for that. Quite obvious really, but sometimes it takes a second pair 
of eyes. 
I even knew that much but that must have stayed in there from early days.
So, all specs green :-)

Thanks

Torsten

On Monday, 3 November 2014 21:56:08 UTC+2, Torsten Rüger wrote:
>
> 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/e7e6dbf5-61ab-48c0-b1cf-3d84e3cf295a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to