[rspec-users] "Tricks" for testing after_create callback???

Rick DeNatale rick.denatale at gmail.com
Thu Dec 13 09:46:03 EST 2007

On 12/13/07, Rick DeNatale <rick.denatale at gmail.com> wrote:

> class Message < ActiveRecord::Base
>   belongs_to :sender, :class_name => "Person", :foreign_key => :sender_id
>   belongs_to :recipient, :class_name => "Person", :foreign_key => :recipient_id
>   after_create do |msg|
>     puts "\n**** after_create #{msg}\n#{caller.join("\n")}\n"

Of course that puts isn't really there, it's a remnant of my attempts
to debug David's suggestion.

Rick DeNatale

My blog on Ruby

More information about the rspec-users mailing list