Sha256: 120fbd6e42e1a3f38251d82c49affedaaa0d3d5d76af0549576024ccc968049a

Contents?: true

Size: 609 Bytes

Versions: 13

Compression:

Stored size: 609 Bytes

Contents

require File.dirname(__FILE__) + '/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

13 entries across 13 versions & 1 rubygems

Version Path
couch_potato-0.2.27 spec/create_spec.rb
couch_potato-0.2.26 spec/create_spec.rb
couch_potato-0.2.25 spec/create_spec.rb
couch_potato-0.2.24 spec/create_spec.rb
couch_potato-0.2.23 spec/create_spec.rb
couch_potato-0.2.22 spec/create_spec.rb
couch_potato-0.2.21 spec/create_spec.rb
couch_potato-0.2.20 spec/create_spec.rb
couch_potato-0.2.19 spec/create_spec.rb
couch_potato-0.2.18 spec/create_spec.rb
couch_potato-0.2.17 spec/create_spec.rb
couch_potato-0.2.16 spec/create_spec.rb
couch_potato-0.2.15 spec/create_spec.rb