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? class User < ActiveRecord::Base after_create :run_something ... end Factory: FactoryGirl.define do factory :user do first_name "Luiz" last_name "Branco" ... # skip callback factory :with_run_something do # run callback end end
{{#tags}}- {{label}}
{{/tags}}