[rspec-users] Testing that a model helper method is called
Pat Maddox
pergesu at gmail.com
Wed Mar 5 13:10:52 EST 2008
On Wed, Mar 5, 2008 at 10:05 AM, Corey Haines <coreyhaines at gmail.com> wrote:
> So, I have a plugin that adds a method to ActiveRecord::Base, let's call the
> method is_encrypted.
>
> class MyModel < ActiveRecord::Base
>
> is_encrypted
>
> end
>
> So, my question is, how do I write a spec to show that is_encrypted is
> called here? I would rather not write specs that say that the behavior is
> there, since I have tested the behavior already in my plugin.
MyModel.should_receive(:is_encrypted)
load "my_model.rb"
Pat
More information about the rspec-users
mailing list