I just started to get lots of AssociationTypeMismatch errors in my Rspec tests. I’m using Guard and noticed the error start on the test I was writing at the time then when I ran the full suite I got:
217 examples, 83 failures, 27 pending
Prior to today all tests were passing fine.
I’m confused by the error because although it’s an
AssociationTypeMismatch it’s actually returning the correctly-named model.
Failure/Error: family = create(:family) ActiveRecord::AssociationTypeMismatch: School(#47111200) expected, got School(#46218540)
I’m building the particular model in this error,
School, in a
config.before(:each) support file but I’m also getting the same error relating to other models in the app.
How can I go about debugging this issue?