Sha256: 08ad2e7ca4689c54574b02e66444c96074c8d4178f387ac84ff12a3d1d644185

Contents?: true

Size: 643 Bytes

Versions: 1

Compression:

Stored size: 643 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_behaves_like :database

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
upsert-0.0.1 test/test_pg.rb