I\'m testing a model with an after create callback that I\'d like to run only on some occasions while testing. How can I skip/run callbacks from a factory?
c
None of these solutions are good. They deface the class by removing functionality that should be removed from the instance, not from the class.
factory :user do
before(:create){|user| user.define_singleton_method(:send_welcome_email){}}
Instead of suppressing the callback, I am suppressing the functionality of the callback. In a way, I like this approach better because it is more explicit.