snailgun icon indicating copy to clipboard operation
snailgun copied to clipboard

Problems with class reloading if factory_girl is being used

Open tobsch opened this issue 15 years ago • 2 comments

Hi there,

we had a problem with several models that weren't reloaded properly. I just traced it down and it's the funny combination snailgun & factory_girl:

If you use factory_girl and load in in test_helper, all models are being loaded by snailgun because it manually requires test_helper. If you disable loading test helper everything works fine.

Best,

Tobias

tobsch avatar Nov 09 '10 14:11 tobsch

If you can make a patch which fixes this, I'll commit it. I'm afraid I don't know what it would be about factory_girl which would cause test_helper to preload all models.

Is this a rails app? You do have config.cache_classes = false in config/environments/test.rb ?

candlerb avatar Dec 03 '10 22:12 candlerb

Any feedback on this?

I'm experiencing similar issue without using factory girl.

(Some) Models seem to not get reloaded while other Classes like Tests or Helpers.

phoet avatar Mar 03 '11 14:03 phoet