Sha256: 2df0fe7092aa99c32949450296cce22ab658145e6f557b2e56ef5082180e1ff0

Contents?: true

Size: 1.04 KB

Versions: 39

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) { mock('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

39 entries across 33 versions & 5 rubygems

Version Path
raffle_v1-0.0.5 lib/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-1.1.1 spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-1.1.0 spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-1.0.1 spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-1.0.0.RC1 spec/database_cleaner/couch_potato/truncation_spec.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.9.1/spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-0.9.1 spec/database_cleaner/couch_potato/truncation_spec.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.8.0/spec/database_cleaner/couch_potato/truncation_spec.rb
database_cleaner-0.8.0 spec/database_cleaner/couch_potato/truncation_spec.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb