Sha256: 2a99ecab8cbf040c645484fb9d5c9a319c1609af9c5fe7d1730a3508ece4a4f6

Contents?: true

Size: 622 Bytes

Versions: 16

Compression:

Stored size: 622 Bytes

Contents

require 'spec_helper'

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
couch_potato-1.17.0 spec/destroy_spec.rb
couch_potato-1.16.0 spec/destroy_spec.rb
couch_potato-1.15.0 spec/destroy_spec.rb
couch_potato-1.14.0 spec/destroy_spec.rb
couch_potato-1.13.0 spec/destroy_spec.rb
couch_potato-1.12.1 spec/destroy_spec.rb
couch_potato-1.12.0 spec/destroy_spec.rb
couch_potato-1.11.0 spec/destroy_spec.rb
couch_potato-1.10.1 spec/destroy_spec.rb
couch_potato-1.10.0 spec/destroy_spec.rb
couch_potato-1.9.0 spec/destroy_spec.rb
couch_potato-1.7.1 spec/destroy_spec.rb
couch_potato-1.7.0 spec/destroy_spec.rb
couch_potato-1.6.5 spec/destroy_spec.rb
couch_potato-1.6.4 spec/destroy_spec.rb
couch_potato-1.6.3 spec/destroy_spec.rb