Skip to content
Browse files

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.
  • Loading branch information...
1 parent 7934124 commit f159b0a5a8e0c43942e8d60eb27a51f2679afa3e @senny senny committed Apr 2, 2014
Showing with 5 additions and 2 deletions.
  1. +5 −2 activerecord/test/cases/adapters/postgresql/range_test.rb
View
7 activerecord/test/cases/adapters/postgresql/range_test.rb
@@ -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,

0 comments on commit f159b0a

Please sign in to comment.
Something went wrong with that request. Please try again.