Sha256: dd5c422c44d80dbf9e239a95c37f37a2d1a66684ab8f60130ce6707e962887dc

Contents?: true

Size: 864 Bytes

Versions: 1

Compression:

Stored size: 864 Bytes

Contents

require 'helper'
require 'pg'

system %{ dropdb test_upsert }
system %{ createdb test_upsert }
ActiveRecord::Base.establish_connection :adapter => 'postgresql', :database => 'test_upsert'

describe "upserting on postgresql" 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| c.finish }
  end
  def new_connection
    c = PG.connect(:dbname => 'test_upsert')
    @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

1 entries across 1 versions & 1 rubygems

Version Path
upsert-0.1.0 test/test_pg.rb