Sha256: 90f140333f798498b374364d5d09d99458dad4053dcf86cdcca76a7fa7ed6f59

Contents?: true

Size: 583 Bytes

Versions: 4

Compression:

Stored size: 583 Bytes

Contents

require 'spec_helper'

describe "create" do
  before(:all) do
    recreate_db
  end
  describe "succeeds" do
    it "should store the class" do
      @comment = Comment.new :title => 'my_title'
      CouchPotato.database.save_document! @comment
      CouchPotato.couchrest_database.get(@comment.id).send(JSON.create_id).should == 'Comment'
    end
  end
  describe "fails" do
    it "should not store anything" do
      @comment = Comment.new
      CouchPotato.database.save_document @comment
      CouchPotato.couchrest_database.documents['rows'].should be_empty
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
couch_potato-0.2.31 spec/create_spec.rb
couch_potato-0.2.30 spec/create_spec.rb
couch_potato-0.2.29 spec/create_spec.rb
couch_potato-0.2.28 spec/create_spec.rb