micro-blogger/test/test_helper.rb

33 lines
985 B
Ruby
Raw Normal View History

2018-11-10 10:40:22 -06:00
# frozen_string_literal: true
2018-11-09 20:51:38 -06:00
ENV['RAILS_ENV'] ||= 'test'
2018-11-10 10:40:22 -06:00
# https://github.com/colszowka/simplecov
require 'simplecov'
SimpleCov.start 'rails' do
add_group 'Models', %w[app/models app/validators]
add_group 'Commands & Libs', %w[app/workers app/services app/libs app/commands]
add_group "Jobs", 'app/jobs'
add_group "Policies", 'app/policies'
end
Rails.application.eager_load!
2018-11-09 20:51:38 -06:00
require_relative '../config/environment'
require 'rails/test_help'
2018-11-10 10:40:22 -06:00
require 'minitest/reporters'
require 'policy_assertions'
Dir[Rails.root.join("test", "test_helpers", "**", "*.rb")].each { |f| require f }
Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(color: true)]
2018-11-09 20:51:38 -06:00
class ActiveSupport::TestCase
2018-11-10 10:40:22 -06:00
ActiveRecord::Migration.maintain_test_schema!
ActiveRecord::Migration.check_pending!
2018-11-09 20:51:38 -06:00
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
# Add more helper methods to be used by all tests here...
2018-11-10 10:40:22 -06:00
include AuthTestHelper
2018-11-09 20:51:38 -06:00
end