I can't test after_commit callbacks with the on option
this is valid:
after_commit :update_average_password_scores, :on => :destroy, :if => :active?
so tried to test with:
it { should callback(:update_average_password_scores).after(:commit).on(:destroy).if(:active?) }
but it fails with this error:
Failure/Error: it { should callback(:update_average_password_scores).after(:commit).on(:destroy).if(:active?) }
Shoulda::Callback::Matchers::ActiveModel::UsageError:
The .on option is only valid for the validation lifecycle and cannot be used with commit, use with .before(:validation) or .after(:validation)
It is a valid rails callback but it's not yet supported by the callback matchers. Implementation will be a bit of work though. I'll start on it in the next days.
I can't test after_commit callbacks with the on option
this is valid:
after_commit :update_average_password_scores, :on => :destroy, :if => :active?
so tried to test with:
it { should callback(:update_average_password_scores).after(:commit).on(:destroy).if(:active?) }
but it fails with this error: