Sha256: ff20b3911d5d31e2536ea9829663ec9d603a36a1906b041730aaf9dcfdc8b032

Contents?: true

Size: 828 Bytes

Versions: 1

Compression:

Stored size: 828 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe "create" do
  before(:each) do
    @comment = Comment.new :title => 'my_title'
    @comment.save!
  end
  
  it "should update the revision" do
    old_rev = @comment._rev
    @comment.save!
    @comment._rev.should_not == old_rev
    @comment._rev.should_not be_nil
  end
  
  it "should not update created at" do
    old_created_at = @comment.created_at
    @comment.save!
    @comment.created_at.should == old_created_at
  end
  
  it "should update updated at" do
    old_updated_at = @comment.updated_at
    @comment.save!
    @comment.updated_at.should > old_updated_at
  end
  
  it "should update the attributes" do
    @comment.title = 'new title'
    @comment.save!
    CouchPotato::Persistence.Db.get("#{@comment.id}")['title'].should == 'new title'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
langalex-couch_potato-0.1 spec/update_spec.rb