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

2011-06-29 Thread S Ahmed
Oh and I am grateful for your refactoring and explanations, simplies my code and tests (and understanding!) On Wed, Jun 29, 2011 at 3:19 PM, S Ahmed wrote: > Ok I got it working, and honestly I have no idea why it is working. > > There was a test below it which I modified (I had updated_at inste

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

2011-06-29 Thread S Ahmed
Ok I got it working, and honestly I have no idea why it is working. There was a test below it which I modified (I had updated_at instead of created_at). I ALMOST feel as if the file was cached and not looking at the right file, but not sure if that is even possible. On Wed, Jun 29, 2011 at 3:07

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

2011-06-29 Thread S Ahmed
Your code worked, let me try and figure out why mine isn't working Your right it isn't exactly what I have, but pretty much everything is identical except for the naming of the model. On Wed, Jun 29, 2011 at 2:20 PM, David Chelimsky wrote: > On Jun 29, 2011, at 12:21 PM, S Ahmed wrote: > > >

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

2011-06-29 Thread David Chelimsky
On Jun 29, 2011, at 12:21 PM, S Ahmed wrote: > My method looks like: > > def self.can_do_this(user) > return false if user.nil? > ( (Time.now >= user.created_at) ? true : false ) > end > > my spec: > > it "should allow you to do this" do > user = stub("user") > user.stub(:nil?).and_re

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

2011-06-29 Thread S Ahmed
My method looks like: def self.can_do_this(user) return false if user.nil? ( (Time.now >= user.created_at) ? true : false ) end my spec: it "should allow you to do this" do user = stub("user") user.stub(:nil?).and_return(false) user.stub(:created_at).and_return(Time.now) res = Use