user.should_receive(:encrypt_password).with(your_password) user.save Is this what you want?
On Fri, Jun 20, 2008 at 10:12 AM, Csongor Bartus <[EMAIL PROTECTED]> wrote: > hi all, > > i'm learning rspec and i can't figure out how to test if a callback is > executed in a model. > > my model code is: > > class User < ActiveRecord::Base > before_save :encrypt_password > > ... > > def encrypt(password) > self.class.encrypt(password, salt) > end > > > thanks a lot, > cs. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users