cleanup, reset_pg_session in range_test.rb

Also do not use transactional fixtures. We drop the type and the
table after every run, so there is nothing for the transaction to clean up.
This commit is contained in:
Yves Senn 2014-04-02 09:03:48 +02:00
parent 7934124184
commit f159b0a5a8

@ -1,4 +1,5 @@
require "cases/helper"
require 'support/postgresql_helper'
require 'active_record/base'
require 'active_record/connection_adapters/postgresql_adapter'
@ -8,17 +9,19 @@ class PostgresqlRange < ActiveRecord::Base
end
class PostgresqlRangeTest < ActiveRecord::TestCase
self.use_transactional_fixtures = false
include PostgresqlHelper
teardown do
@connection.execute 'DROP TABLE IF EXISTS postgresql_ranges'
@connection.execute 'DROP TYPE IF EXISTS floatrange'
reset_pg_session
end
def setup
@connection = PostgresqlRange.connection
begin
@connection.transaction do
@connection.execute 'DROP TABLE IF EXISTS postgresql_ranges'
@connection.execute 'DROP TYPE IF EXISTS floatrange'
@connection.execute <<_SQL
CREATE TYPE floatrange AS RANGE (
subtype = float8,