Sha256: fd09b215098f7f7828f27e9382b3aa7dffa3e2f03f41dc85a33921bfe68b9bfd

Contents?: true

Size: 1022 Bytes

Versions: 2

Compression:

Stored size: 1022 Bytes

Contents

require 'helper'

system %{ mysql -u root -ppassword -e "DROP DATABASE IF EXISTS test_upsert; CREATE DATABASE test_upsert CHARSET utf8" }
ActiveRecord::Base.establish_connection :adapter => 'mysql2', :username => 'root', :password => 'password', :database => 'test_upsert', :pool => 2

describe "using an ActiveRecord connection adapter" do
  before do
    ActiveRecord::Base.connection.drop_table(Pet.table_name) rescue nil
    Pet.auto_upgrade!
    @opened_connections = []
    @connection = new_connection
  end
  after do
    @opened_connections.each { |c| ActiveRecord::Base.connection_pool.checkin(c) }
  end
  def new_connection
    c = ActiveRecord::Base.connection_pool.checkout
    @opened_connections << c
    c
  end
  def connection
    @connection
  end

  it_also 'is a database with an upsert trick'

  it_also 'is just as correct as other ways'

  it_also 'can be speeded up with upserting'

  it_also 'supports binary upserts'

  it_also "supports multibyte"

  it_also "doesn't mess with timezones"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
upsert-0.1.1 test/test_active_record_connection_adapter.rb
upsert-0.1.0 test/test_active_record_connection_adapter.rb