2016-09-18 09:41:51 -05:00
|
|
|
# frozen_string_literal: true
|
2016-08-27 15:52:19 -05:00
|
|
|
ENV['RAILS_ENV'] ||= 'test'
|
2016-08-27 16:32:04 -05:00
|
|
|
|
|
|
|
# https://github.com/colszowka/simplecov
|
|
|
|
require 'simplecov'
|
|
|
|
SimpleCov.start 'rails' do
|
|
|
|
add_group 'Models', %w(app/models app/validators)
|
|
|
|
add_group 'PORO', %w(app/services)
|
|
|
|
end
|
|
|
|
|
2016-08-27 15:52:19 -05:00
|
|
|
require File.expand_path('../../config/environment', __FILE__)
|
|
|
|
require 'rails/test_help'
|
2016-08-27 16:32:04 -05:00
|
|
|
require "minitest/autorun"
|
|
|
|
require 'minitest/reporters'
|
2016-09-17 21:53:41 -05:00
|
|
|
require 'webmock/minitest'
|
2016-08-27 16:32:04 -05:00
|
|
|
Dir[Rails.root.join("test/test_helpers/**/*.rb")].each { |f| require f }
|
|
|
|
|
2016-09-17 21:53:41 -05:00
|
|
|
WebMock.disable_net_connect!(allow_localhost: true)
|
|
|
|
|
2016-08-27 16:32:04 -05:00
|
|
|
Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(color: true)]
|
2016-08-27 15:52:19 -05:00
|
|
|
|
|
|
|
class ActiveSupport::TestCase
|
2016-09-28 22:12:55 -05:00
|
|
|
ActiveRecord::Migration.maintain_test_schema!
|
2016-08-27 16:32:04 -05:00
|
|
|
|
2016-08-27 15:52:19 -05:00
|
|
|
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
|
|
|
fixtures :all
|
2016-10-06 20:10:36 -05:00
|
|
|
|
|
|
|
@@files_checked = false
|
|
|
|
def verify_test_files
|
|
|
|
return if @@files_checked
|
|
|
|
|
|
|
|
FileUtils.mkdir_p AppConfig.ftpusers
|
|
|
|
FileUtils.touch AppConfig.htpasswd
|
|
|
|
@@files_checked = true
|
|
|
|
end
|
|
|
|
|
|
|
|
def setup
|
|
|
|
verify_test_files
|
|
|
|
end
|
2016-08-27 15:52:19 -05:00
|
|
|
end
|