Skip to content

Commit

Permalink
Adding a spec to test issue couchrest#15 (http://github.com/couchrest…
Browse files Browse the repository at this point in the history
  • Loading branch information
tapajos committed Mar 30, 2010
1 parent 54f3a11 commit c2ef5d9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion spec/couchrest/more/extended_doc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require File.expand_path("../../../spec_helper", __FILE__)
require File.join(FIXTURE_PATH, 'more', 'article')
require File.join(FIXTURE_PATH, 'more', 'course')
require File.join(FIXTURE_PATH, 'more', 'card')
require File.join(FIXTURE_PATH, 'more', 'cat')

describe "ExtendedDocument" do
Expand Down Expand Up @@ -426,7 +427,16 @@ def after_initialize
obj.created_at.should be_an_instance_of(Time)
obj.updated_at.should be_an_instance_of(Time)
obj.created_at.to_s.should == @obj.updated_at.to_s
end
end

it "should not change created_at on update" do
2.times do
lambda do
@art.save
end.should_not change(@art, :created_at)
end
end

it "should set the time on create" do
(Time.now - @art.created_at).should < 2
foundart = Article.get @art.id
Expand Down

0 comments on commit c2ef5d9

Please sign in to comment.