I'm having an issue comparing two seemingly equivalent dates:
spec:
it "sets the user's session_key_updated_at" do
now = Time.zone.now
Timecop.freeze(now) do
verify_user
@verified_user.session_key_updated_at.should == now
end
end
output:
sets the user's session_key_updated_at
expected: Fri, 21 Aug 2009 16:08:51 UTC +00:00,
got: Fri, 21 Aug 2009 16:08:51 UTC +00:00 (using ==)
They're identical, no?
They're the same class, too:
now.class:
ActiveSupport::TimeWithZone
@verified_user.session_key_updated_at.class: ActiveSupport::TimeWithZone
Any ideas on what's going on or what I'm doing wrong?
For the record:
> spec -v
rspec 1.2.7
> script/about
About your application's environment
Ruby version 1.8.6 (i686-darwin9.1.0)
RubyGems version 1.3.5
Rack version 1.0
Rails version 2.3.2
Active Record version 2.3.2
Action Pack version 2.3.2
Active Resource version 2.3.2
Action Mailer version 2.3.2
Active Support version 2.3.2
Environment development
Database adapter sqlite3
Database schema version 20090812181104
Thanks,
/g
--
George Anderson
BenevolentCode LLC
[email protected]
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users