Suppose I have the following ActiveRecord class:
class ToastMitten < ActiveRecord::Base before_save :brush_off_crumbs end
Is there a clean way to verify that :brush_off_crumbs was set as a before_save ?
By "clean" I mean:
- "Without actual retention" because
- He is slow
- I do not need to verify that ActiveRecord is correctly managing the
before_save directive; I need to verify that I correctly said what to do before saving it.
- "Without hacking through undocumented methods"
I found a way that meets criteria # 1 but not # 2:
it "should call have brush_off_crumbs as a before_save callback" do
source share