Sha256: 2a6733dfbd513d31fb77b5e57d04d773c92713eb151e8d19d45b2575b58bbed7

Contents?: true

Size: 634 Bytes

Versions: 37

Compression:

Stored size: 634 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
    @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

37 entries across 37 versions & 3 rubygems

Version Path
couch_potato-1.4.0 spec/destroy_spec.rb
couch_potato-1.3.0 spec/destroy_spec.rb
couch_potato-1.2.0 spec/destroy_spec.rb
couch_potato-1.1.4 spec/destroy_spec.rb
couch_potato-1.1.2 spec/destroy_spec.rb
couch_potato-1.1.1 spec/destroy_spec.rb
couch_potato-1.1.0 spec/destroy_spec.rb
couch_potato-1.0.1 spec/destroy_spec.rb
couch_potato-1.0.0 spec/destroy_spec.rb
couch_potato-0.7.1 spec/destroy_spec.rb
couch_potato-0.7.0 spec/destroy_spec.rb
couch_potato-0.7.0.pre.1 spec/destroy_spec.rb
couch_potato-0.6.0 spec/destroy_spec.rb
couch_potato-0.5.7 spec/destroy_spec.rb
couch_potato-rails2-0.5.10 spec/destroy_spec.rb
couch_potato-rails2-0.5.9 spec/destroy_spec.rb
couch_potato-rails2-0.5.8 spec/destroy_spec.rb
couch_potato-rails2-0.5.7 spec/destroy_spec.rb
couch_potato-rails2-0.5.6 spec/destroy_spec.rb
couch_potato-0.5.6 spec/destroy_spec.rb