mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 20:55:44 +02:00
* It allows access from anywhere via wildcard origin * It sets the timeout to an hour * It allows all standard HTTP verbs + OPTIONS
51 lines
1.2 KiB
Ruby
51 lines
1.2 KiB
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_assertions' # Remove once upgraded to Rails 5
|
|
require 'support/task_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
|
|
|
|
# Allows testing OPTIONS request just like GET or POST
|
|
module ActionDispatch::Integration::RequestHelpers
|
|
def options(path, parameters = nil, headers_or_env = nil)
|
|
process :options, path, parameters, headers_or_env
|
|
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
|
|
|
|
require 'application_system_test_case'
|