I have some Rails Active Record models with "on create" callbacks. I'd
like to avoid them for some specific factories / traits . I was
thinking doing so :
factory :stuff_without_cb do
after_build do |item|
item.stub(:method_name)
end
after_create do |item|
item.unstub(:method_name)
end
end
The problem is that if there a stub method in factory girl from within
factory girl, i haven't found any "unstub" one , does anybody know a
work-around ?
Thanks in advance,
PS: i'm using Rspec , which doesn't seem to be loaded when my
factories are parsed (i'm using the last factory_girl_rails gem)
nicolas