Sha256: 4a7bc69753e8ba1a0960675c99e4977ff32c0ed56349b86c07d7eda194ea6076

Contents?: true

Size: 602 Bytes

Versions: 7

Compression:

Stored size: 602 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'
      CouchTomato.database.save_document! @comment
      CouchTomato.couchrest_database.get(@comment.id)['ruby_class'].should == 'Comment'
    end
  end
  describe "fails" do
    it "should not store anything" do
      @comment = Comment.new
      CouchTomato.database.save_document @comment
      CouchTomato.couchrest_database.documents['rows'].should be_empty
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
couch_tomato-0.2.0 spec/create_spec.rb
couch_tomato-0.1.5 spec/create_spec.rb
couch_tomato-0.1.4 spec/create_spec.rb
couch_tomato-0.1.3 spec/create_spec.rb
couch_tomato-0.1.2 spec/create_spec.rb
couch_tomato-0.1.1 spec/create_spec.rb
couch_tomato-0.1.0 spec/create_spec.rb