jdliss / shoulda-callback-matchers

Test existence of your Rails callbacks without having to call them
MIT License
134 stars 18 forks source link

Support for After Commit #1

Closed allenwyma closed 11 years ago

allenwyma commented 11 years ago

Does this also work for after_commit? Would love to use this instead of after_commit gem.

beatrichartz commented 11 years ago

This does work for after_commit

it { should callback(:something).after(:commit) }

However, this gem is for testing that the callbacks are there, not to install the callbacks themselves, so it does not substitute after_commit or rails callbacks.

allenwyma commented 11 years ago

What about after_commit on: :create?

beatrichartz commented 11 years ago

This is also possible:

it { should callback(:something).after(:commit).on(:create) }