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:
parent
7934124184
commit
f159b0a5a8
1 changed files with 5 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue