1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

View file

@ -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 @@ if ActiveRecord::Base.connection.supports_ranges?
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,