Envek/after_commit_everywhere

Braking tests

axos88 opened this issue · 3 comments

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,

NVM

Envek commented

No configuration required, gem itself will determine if it is running inside of “test transaction”:

# service transactions (tests and database_cleaner) are not joinable
connection.transaction_open? && connection.current_transaction.joinable?

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

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