mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 13:15:40 +02:00
In the future, ApplicationSystemTestCase should inherit from ActionDispatch::SystemTestCase and JavaScriptApplicationSystemTestCase could possibly be removed if the `driven_by` method works as it is promised in Rails documentation: http://api.rubyonrails.org/v5.2/classes/ActionDispatch/SystemTestCase.html Consider introducing another class between ActionDispatch::IntegrationTest and other items inheriting from it, as the general Rails practice seems to have `ApplicationIntegrationTest`, as we do have `ApplicationRecord` and `ApplicationController`.
43 lines
969 B
Ruby
43 lines
969 B
Ruby
if ENV['COVERAGE']
|
|
require 'simplecov'
|
|
SimpleCov.command_name 'test'
|
|
SimpleCov.start 'rails'
|
|
end
|
|
|
|
ENV['RAILS_ENV'] ||= 'test'
|
|
require File.expand_path('../../config/environment', __FILE__)
|
|
require 'rails/test_help'
|
|
require 'minitest/mock'
|
|
require 'capybara/rails'
|
|
require 'capybara/minitest'
|
|
require 'webmock/minitest'
|
|
require 'support/rails5_assetions' # Remove once upgraded to Rails 5
|
|
|
|
require 'application_system_test_case'
|
|
|
|
Setting.address_processing = false
|
|
Setting.registry_country_code = 'US'
|
|
|
|
class ActiveSupport::TestCase
|
|
include FactoryBot::Syntax::Methods
|
|
|
|
ActiveRecord::Migration.check_pending!
|
|
fixtures :all
|
|
|
|
teardown do
|
|
travel_back
|
|
end
|
|
end
|
|
|
|
class 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
|