Rspec crashes with ActiveRecord :: AssociationTypeMismatch "x" is expected to receive "x" when all specifications are run; but not when separately

I am new to a project that has some spec scope, and when I run all the specifications, all the mappings fail with the same ActiveRecord :: AssociationTypeMismatch "x" expected to get "x", for example:

ActiveRecord :: AssociationTypeMismatch: User (# 103950560) expected, received User (# 107825100)

There is one specification that, with exception, does all the work. And by itself, it separately works normally.

I can't post content here, I think, although 8 (

cache_classes = true allows this.

My colleagues on Macs do not have this error, while I and a few people on Ubuntu have.

+3
source share
1 answer

I had the same problem, I updated factory_girl_railsto the latest version, typing factory_girlfrom 2.6.4to 3.2.0and fixed it!

+1
source

All Articles