Sha256: dda1c036a4815a50651a6250d3b9e83f8881229cdae0f9cd6737fe92969bcc79

Contents?: true

Size: 974 Bytes

Versions: 19

Compression:

Stored size: 974 Bytes

Contents

require 'spec_helper'
require 'active_record'
require 'support/active_record/mysql_setup'
require 'database_cleaner/active_record/truncation'
require 'database_cleaner/active_record/truncation/shared_fast_truncation'

module ActiveRecord
  module ConnectionAdapters
    describe do
      before(:all) { active_record_mysql_setup }

      let(:connection) { active_record_mysql_connection }

      describe "#truncate_table" do
        it "should truncate the table" do
          2.times { User.create }

          connection.truncate_table('users')
          User.count.should eq 0
        end

        it "should reset AUTO_INCREMENT index of table" do
          2.times { User.create }
          User.delete_all

          connection.truncate_table('users')

          User.create.id.should eq 1
        end
      end

      it_behaves_like "an adapter with pre-count truncation" do
        let(:connection) { active_record_mysql_connection }
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
database_cleaner-1.6.2 spec/database_cleaner/active_record/truncation/mysql_spec.rb
database_cleaner-1.6.1 spec/database_cleaner/active_record/truncation/mysql_spec.rb
database_cleaner-1.6.0 spec/database_cleaner/active_record/truncation/mysql_spec.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/active_record/truncation/mysql_spec.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/active_record/truncation/mysql_spec.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/active_record/truncation/mysql_spec.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/active_record/truncation/mysql_spec.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/active_record/truncation/mysql_spec.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/active_record/truncation/mysql_spec.rb
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/active_record/truncation/mysql_spec.rb
database_cleaner-1.5.3 spec/database_cleaner/active_record/truncation/mysql_spec.rb
database_cleaner-1.5.2 spec/database_cleaner/active_record/truncation/mysql_spec.rb
database_cleaner-1.5.1 spec/database_cleaner/active_record/truncation/mysql_spec.rb
database_cleaner-1.5.0 spec/database_cleaner/active_record/truncation/mysql_spec.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/database_cleaner-1.4.1/spec/database_cleaner/active_record/truncation/mysql_spec.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/database_cleaner-1.4.1/spec/database_cleaner/active_record/truncation/mysql_spec.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/database_cleaner-1.4.1/spec/database_cleaner/active_record/truncation/mysql_spec.rb
database_cleaner-1.4.1 spec/database_cleaner/active_record/truncation/mysql_spec.rb
database_cleaner-1.4.0 spec/database_cleaner/active_record/truncation/mysql_spec.rb