[rspec-users] "user" received unexpected message :created_at with (no args)

S Ahmed sahmed1020 at gmail.com
Wed Jun 29 13:21:07 EDT 2011

My method looks like:

def self.can_do_this(user)
  return false if user.nil?
  (  (Time.now >= user.created_at) ? true : false  )

my spec:

it "should allow you to do this" do
  user = stub("user")

  res = User.can_do_this(user)
  res.should == true

Running the spec I get:

Failer/Error: res = User.can_do_this(user)
Stub "user" received unexpected message :created_at with (no args)

Any ideas?

Thanks allot for the help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110629/88768fe5/attachment.html>

More information about the rspec-users mailing list