spec/update_spec.rb in langalex-couch_potato-0.1 vs spec/update_spec.rb in langalex-couch_potato-0.1.1
- old
+ new
@@ -1,15 +1,20 @@
require File.dirname(__FILE__) + '/spec_helper'
describe "create" do
+ before(:all) do
+ CouchPotato::Persistence.Db!
+ end
+
before(:each) do
@comment = Comment.new :title => 'my_title'
@comment.save!
end
it "should update the revision" do
old_rev = @comment._rev
+ @comment.title = 'xyz'
@comment.save!
@comment._rev.should_not == old_rev
@comment._rev.should_not be_nil
end
@@ -19,9 +24,10 @@
@comment.created_at.should == old_created_at
end
it "should update updated at" do
old_updated_at = @comment.updated_at
+ @comment.title = 'xyz'
@comment.save!
@comment.updated_at.should > old_updated_at
end
it "should update the attributes" do
\ No newline at end of file