Sha256: 9f9ee84f962eb30112158c3656920a3feb50767406bc12e04d1d5783a71b3233

Contents?: true

Size: 1.12 KB

Versions: 4

Compression:

Stored size: 1.12 KB

Contents

ENV['RAILS_ENV'] ||= 'test'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup'
Bundler.require :default, :development
require 'second_base'
require 'active_support/test_case'
require 'active_support/testing/autorun'

if Rails.version.to_i == 4
  require 'dummy_apps/rails_four/init'
else
  require 'dummy_apps/rails_five/init'
end

require 'rails/test_help'
Dir['test/test_helpers/*.{rb}'].each { |f| require_relative "../#{f}" }

ActiveSupport.test_order = :random if ActiveSupport.respond_to?(:test_order)

module SecondBase
  class TestCase < ActiveSupport::TestCase

    if Rails.version.to_i == 4
      self.use_transactional_fixtures = false
    else
      self.use_transactional_tests = false
    end

    include RailsVersionHelpers,
            DummyAppHelpers,
            StreamHelpers

    setup    :delete_dummy_files
    teardown :delete_dummy_files

    private

    def establish_connection
      ActiveRecord::Base.establish_connection
      ActiveRecord::Base.connection
      SecondBase::Base.establish_connection(SecondBase.config)
      SecondBase::Base.connection
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
secondbase-2.1.3 test/test_helper.rb
secondbase-2.1.2 test/test_helper.rb
secondbase-2.1.0 test/test_helper.rb
secondbase-2.0.0 test/test_helper.rb