Sha256: 1f902872edd84efc5fc5267ade6d3699c4f917b9b7a89a953c2e5b701c2acb89

Contents?: true

Size: 660 Bytes

Versions: 35

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'
    CouchPotato.database.save_document! @comment
    @comment_id = @comment.id
    CouchPotato.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 {
      CouchPotato.couchrest_database.get(@comment_id).should
    }.should raise_error(RestClient::ResourceNotFound)
  end
  
end

Version data entries

35 entries across 35 versions & 5 rubygems

Version Path
andrewtimberlake-couch_potato-0.2.8.1 spec/destroy_spec.rb
andrewtimberlake-couch_potato-0.2.8.2 spec/destroy_spec.rb
andrewtimberlake-couch_potato-0.2.8.3 spec/destroy_spec.rb
andrewtimberlake-couch_potato-0.2.8.4 spec/destroy_spec.rb
langalex-couch_potato-0.2.0 spec/destroy_spec.rb
langalex-couch_potato-0.2.1 spec/destroy_spec.rb
langalex-couch_potato-0.2.11 spec/destroy_spec.rb
langalex-couch_potato-0.2.12 spec/destroy_spec.rb
langalex-couch_potato-0.2.2 spec/destroy_spec.rb
langalex-couch_potato-0.2.3 spec/destroy_spec.rb
langalex-couch_potato-0.2.4 spec/destroy_spec.rb
langalex-couch_potato-0.2.5 spec/destroy_spec.rb
langalex-couch_potato-0.2.6 spec/destroy_spec.rb
langalex-couch_potato-0.2.7 spec/destroy_spec.rb
langalex-couch_potato-0.2.8 spec/destroy_spec.rb
langalex-couch_potato-0.2.9 spec/destroy_spec.rb
speedmax-couch_potato-0.2.0 spec/destroy_spec.rb
speedmax-couch_potato-0.2.2 spec/destroy_spec.rb
thefool808-couch_potato-0.2.7 spec/destroy_spec.rb
couch_potato-0.2.27 spec/destroy_spec.rb