Envek / after_commit_everywhere

Use ActiveRecord transactional callbacks outside of models, literally everywhere in your application.
MIT License
690 stars 22 forks source link

Braking tests #2

Closed axos88 closed 6 years ago

axos88 commented 6 years ago

Hello!

Is there a way to configure thig gem to ignore transactions when in tests? Our DatabaseCleaner is set up to use rollbacks, so obviously the transactions are not committed before the expectations, and the tests fail.

The README.md sais it's working with DBCleaner, but can you include a few lines on how to set it up?

Thanks,

axos88 commented 6 years ago

NVM

Envek commented 6 years ago

No configuration required, gem itself will determine if it is running inside of “test transaction”: https://github.com/Envek/after_commit_everywhere/blob/57ad6aa1658fdf3dd4f638955af09d653e0afdbb/lib/after_commit_everywhere.rb#L93-L94

Could you please share what and why didn't work with your test suite so other users could find and fix too?

axos88 commented 6 years ago

It was simply a typo, so unrelated to this gem. Yey dynamic languages :|