Sha256: af37eb53b217e2cca750df8a06d5f22559657d010271ab8a779ef19194e0faf5

Contents?: true

Size: 1.04 KB

Versions: 27

Compression:

Stored size: 1.04 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper'
require 'database_cleaner/couch_potato/truncation'
require 'couch_potato'

module DatabaseCleaner
  module CouchPotato

    describe Truncation do
      let(:database) { double('database') }

      before(:each) do
        ::CouchPotato.stub(:couchrest_database).and_return(database)
      end

      it "should re-create the database" do
        database.should_receive(:recreate!)

        Truncation.new.clean
      end

      it "should raise an error when the :only option is used" do
        running {
          Truncation.new(:only => ['document-type'])
        }.should raise_error(ArgumentError)
      end

      it "should raise an error when the :except option is used" do
        running {
          Truncation.new(:except => ['document-type'])
        }.should raise_error(ArgumentError)
      end

      it "should raise an error when invalid options are provided" do
        running {
          Truncation.new(:foo => 'bar')
        }.should raise_error(ArgumentError)
      end
    end

  end
end

Version data entries

27 entries across 22 versions & 4 rubygems

Version Path
database_cleaner-1.6.2 spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-1.6.1 spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-1.6.0 spec/database_cleaner/couch_potato/truncation_spec.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/couch_potato/truncation_spec.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/couch_potato/truncation_spec.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/couch_potato/truncation_spec.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/couch_potato/truncation_spec.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/couch_potato/truncation_spec.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/couch_potato/truncation_spec.rb
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-1.5.3 spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-1.5.2 spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-1.5.1 spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-1.5.0 spec/database_cleaner/couch_potato/truncation_spec.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/database_cleaner-1.4.1/spec/database_cleaner/couch_potato/truncation_spec.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/database_cleaner-1.4.1/spec/database_cleaner/couch_potato/truncation_spec.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/database_cleaner-1.4.1/spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-1.4.1 spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-1.4.0 spec/database_cleaner/couch_potato/truncation_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/database_cleaner-1.2.0/spec/database_cleaner/couch_potato/truncation_spec.rb