spec/lib/model_spec.rb in couch_surfer-0.3.3 vs spec/lib/model_spec.rb in couch_surfer-0.3.4
- old
+ new
@@ -542,19 +542,20 @@
before(:each) do
oldart = Article.get "saving-this" rescue nil
oldart.destroy if oldart
@art = Article.new(:title => "Saving this")
@art.save
+ @art.reload
end
it "should set the time on create" do
(Time.now - @art.created_at).should < 2
foundart = Article.get @art.id
foundart.created_at.should == foundart.updated_at
end
it "should set the time on update" do
sleep 1 # HACK!! Sometimes takes less than a second to call save the second time. Really should mock this!
@art.save
- @art.created_at.should < @art.updated_at
+ @art.reload.created_at.should < @art.updated_at
end
it "should return both created_at and updated_at as instances of Time" do
@art.created_at.should be_kind_of(Time)
@art.updated_at.should be_kind_of(Time)