Sha256: fb7c53156d90739d1b1bb8d880170abc2a5edb72532a5305630af1027b6d1ae9

Contents?: true

Size: 593 Bytes

Versions: 11

Compression:

Stored size: 593 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

class DatabaseRewinder::InsertRecorderTest < ActiveSupport::TestCase
  setup do
    DatabaseRewinder.init
    Foo.create! name: 'foo1'
    Bar.connection.execute "insert into bars (name) values ('bar1')"
    DatabaseRewinder.cleaners
  end

  test '#execute' do
    cleaner = DatabaseRewinder.instance_variable_get(:'@cleaners').detect {|c| c.db == (ENV['DB'] == 'sqlite3' ? 'db/database_rewinder_test.sqlite3' : 'database_rewinder_test')}

    assert_equal %w(foos bars), cleaner.inserted_tables
    assert_not_nil cleaner.pool
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
database_rewinder-1.0.1 test/active_record_monkey_test.rb
database_rewinder-1.0.0 test/active_record_monkey_test.rb
database_rewinder-0.9.9 test/active_record_monkey_test.rb
database_rewinder-0.9.8 test/active_record_monkey_test.rb
database_rewinder-0.9.7 test/active_record_monkey_test.rb
database_rewinder-0.9.6 test/active_record_monkey_test.rb
database_rewinder-0.9.5 test/active_record_monkey_test.rb
database_rewinder-0.9.4 test/active_record_monkey_test.rb
database_rewinder-0.9.3 test/active_record_monkey_test.rb
database_rewinder-0.9.2 test/active_record_monkey_test.rb
database_rewinder-0.9.1 test/active_record_monkey_test.rb