Sha256: 5e8fa79e893fa400edaac5b7590ddba6f845a7d4271205e7660b84cf103f7b57

Contents?: true

Size: 660 Bytes

Versions: 7

Compression:

Stored size: 660 Bytes

Contents

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

describe 'destroy' do
  before(:all) do
    recreate_db
  end
  
  before(:each) do
    @comment = Comment.new :title => 'title'
    CouchTomato.database.save_document! @comment
    @comment_id = @comment.id
    CouchTomato.database.destroy_document @comment
  end
  
  it "should unset the id" do
    @comment._id.should be_nil
  end
  
  it "should unset the revision" do
    @comment._rev.should be_nil
  end
  
  it "should remove the document from the database" do
    lambda {
      CouchTomato.couchrest_database.get(@comment_id).should
    }.should raise_error(RestClient::ResourceNotFound)
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

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