mirror of
https://github.com/internetee/registry.git
synced 2025-06-05 20:27:30 +02:00
example workflow Update ruby.yml limit builds Update ruby.yml postgres service Update ruby.yml pg_port copy config files Update ruby.yml Update ruby.yml Update database_travis.yml Update ruby.yml Update ruby.yml bump wkhtmltopdf-binary Unlock gem 'wkhtmltopdf-binary' Update ruby.yml Update ruby.yml Update ruby.yml remove Lockfile restore Gemfile test only ubuntu-18.04 bundle env remove deploy deps remove mina dep use rexml from bundle rather then std-lib to support ruby 3.0 install rexml drop ruby 3.0, cleanup workflow fix codeclimate sorting issue Codeclimate reporting stop using deprecated set-env use simplecov formater simplecov in after-build fix yaml syntax run in debug mode Set correct env var to run coverage cleanup, provide CC_TEST_REPORTER_ID secret combine multiple results more variables pull/commit different envs Change test command to get more coverage
67 lines
1.7 KiB
Ruby
67 lines
1.7 KiB
Ruby
if ENV['COVERAGE']
|
|
require 'simplecov'
|
|
SimpleCov.start 'rails' do
|
|
add_filter '/app/models/version/'
|
|
add_filter '/lib/action_controller/'
|
|
add_filter '/lib/core_monkey_patches/'
|
|
add_filter '/lib/daemons/'
|
|
add_filter '/lib/gem_monkey_patches/'
|
|
add_filter '/lib/tasks/'
|
|
end
|
|
end
|
|
|
|
ENV['RAILS_ENV'] ||= 'test'
|
|
require_relative '../config/environment'
|
|
require 'rails/test_help'
|
|
require 'minitest/mock'
|
|
require 'capybara/rails'
|
|
require 'capybara/minitest'
|
|
require 'webmock/minitest'
|
|
require 'support/assertions/epp_assertions'
|
|
|
|
|
|
# `bin/rails test` is not the same as `bin/rake test`.
|
|
# All tasks will be loaded (and executed) twice when using the former without `Rake::Task.clear`.
|
|
# https://github.com/rails/rails/issues/28786
|
|
require 'rake'
|
|
Rake::Task.clear
|
|
Rails.application.load_tasks
|
|
|
|
class CompanyRegisterClientStub
|
|
Company = Struct.new(:registration_number, :company_name)
|
|
|
|
def representation_rights(citizen_personal_code:, citizen_country_code:)
|
|
[Company.new('1234567', 'ACME Ltd')]
|
|
end
|
|
end
|
|
|
|
CompanyRegister::Client = CompanyRegisterClientStub
|
|
|
|
EInvoice.provider = EInvoice::Providers::TestProvider.new
|
|
|
|
class ActiveSupport::TestCase
|
|
ActiveRecord::Migration.check_pending!
|
|
fixtures :all
|
|
set_fixture_class log_domains: DomainVersion
|
|
|
|
teardown do
|
|
travel_back
|
|
end
|
|
end
|
|
|
|
class ApplicationIntegrationTest < ActionDispatch::IntegrationTest
|
|
include Capybara::DSL
|
|
include Capybara::Minitest::Assertions
|
|
include AbstractController::Translation
|
|
include Devise::Test::IntegrationHelpers
|
|
|
|
teardown do
|
|
WebMock.reset!
|
|
Capybara.reset_sessions!
|
|
Capybara.use_default_driver
|
|
end
|
|
end
|
|
|
|
class EppTestCase < ActionDispatch::IntegrationTest
|
|
include Assertions::EppAssertions
|
|
end
|