In order to test an after_commit hook, the test can't be run within a transaction wrapper, which by default is being applied to all RSpec examples. To work around this, I added a :rollback => false RSpec metadata to disable the wrapper on a per-example basis.
For ActiveType::Object, it is OK to commit the transaction, because there is no backing table that will affected.
Fixes #47.
In order to test an
after_commit
hook, the test can't be run within a transaction wrapper, which by default is being applied to all RSpec examples. To work around this, I added a:rollback => false
RSpec metadata to disable the wrapper on a per-example basis.For ActiveType::Object, it is OK to commit the transaction, because there is no backing table that will affected.