Callback defined in a trait and used by a subfactory is called twice #393

Closed
eric-smartlove opened this Issue Jun 19, 2012 · 2 comments

Projects

None yet

2 participants

@eric-smartlove

I had a problem when I update FactoryGirl from 3.3.0 to 3.4.1.

I isolated the problem here : https://gist.github.com/2956851

With FactoryGirl 3.3.0 all these tests are passing.
With FactoryGirl 3.4.1, the third test (the last one) fails.

It seems that when a callback is defined in a trait that is used by a subfactory (nested factory) it is called twice.

Maybe I misuse FactoryGirl but what I am doing wrong is not obvious to me.

@joshuaclayton
Member

@eric-smartlove Thanks for reporting this! I confirmed the bug and fixed it in the above commit. I've also cut version 3.4.2 of the gem. Grab a copy and let me know if you see any other issues!

Thanks!

@eric-smartlove

It's ok with FactoryGirl 3.4.2, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment