2019-08-16 20:09:33 +03:00
|
|
|
# frozen_string_literal: true
|
2020-05-21 00:12:51 +03:00
|
|
|
require "simplecov"
|
2020-05-21 00:50:06 +03:00
|
|
|
require "simplecov-erb"
|
2020-05-21 00:12:51 +03:00
|
|
|
|
|
|
|
SimpleCov.start do
|
|
|
|
formatter SimpleCov::Formatter::MultiFormatter.new([
|
2020-05-21 00:50:06 +03:00
|
|
|
SimpleCov::Formatter::ERBFormatter,
|
2020-05-21 00:12:51 +03:00
|
|
|
SimpleCov::Formatter::HTMLFormatter
|
|
|
|
])
|
|
|
|
end
|
2019-08-16 20:09:33 +03:00
|
|
|
|
2020-05-21 01:02:35 +03:00
|
|
|
SimpleCov.minimum_coverage 98 # TODO: Get to 100!
|
2020-05-21 00:42:58 +03:00
|
|
|
|
2019-08-16 20:09:33 +03:00
|
|
|
require "bundler/setup"
|
|
|
|
require "pp"
|
|
|
|
require "pathname"
|
|
|
|
require "minitest/autorun"
|
|
|
|
|
|
|
|
# Configure Rails Envinronment
|
|
|
|
ENV["RAILS_ENV"] = "test"
|
|
|
|
|
|
|
|
require File.expand_path("../config/environment.rb", __FILE__)
|
|
|
|
require "rails/test_help"
|
|
|
|
|
2020-05-06 07:17:44 +03:00
|
|
|
def with_preview_route(new_value)
|
|
|
|
old_value = Rails.application.config.view_component.preview_route
|
|
|
|
Rails.application.config.view_component.preview_route = new_value
|
|
|
|
app.reloader.reload!
|
|
|
|
yield
|
|
|
|
Rails.application.config.view_component.preview_route = old_value
|
|
|
|
app.reloader.reload!
|
2019-12-09 19:07:12 +03:00
|
|
|
end
|