Adding a spec to test issue #15 (http://github.com/couchrest/couchrest/issues#issue/15)
This commit is contained in:
parent
54f3a11efd
commit
c2ef5d9fde
|
@ -3,6 +3,7 @@
|
||||||
require File.expand_path("../../../spec_helper", __FILE__)
|
require File.expand_path("../../../spec_helper", __FILE__)
|
||||||
require File.join(FIXTURE_PATH, 'more', 'article')
|
require File.join(FIXTURE_PATH, 'more', 'article')
|
||||||
require File.join(FIXTURE_PATH, 'more', 'course')
|
require File.join(FIXTURE_PATH, 'more', 'course')
|
||||||
|
require File.join(FIXTURE_PATH, 'more', 'card')
|
||||||
require File.join(FIXTURE_PATH, 'more', 'cat')
|
require File.join(FIXTURE_PATH, 'more', 'cat')
|
||||||
|
|
||||||
describe "ExtendedDocument" do
|
describe "ExtendedDocument" do
|
||||||
|
@ -427,6 +428,15 @@ describe "ExtendedDocument" do
|
||||||
obj.updated_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
|
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
|
it "should set the time on create" do
|
||||||
(Time.now - @art.created_at).should < 2
|
(Time.now - @art.created_at).should < 2
|
||||||
foundart = Article.get @art.id
|
foundart = Article.get @art.id
|
||||||
|
|
Loading…
Reference in a new issue