Merge branch 'master' into remove-spring-gem

# Conflicts:
#	config/environments/test.rb
This commit is contained in:
Artur Beljajev 2018-06-14 13:33:14 +03:00
commit 78d7d5d894
39 changed files with 107 additions and 188 deletions

View file

@ -40,8 +40,8 @@ module DomainNameRegistry
# Autoload all model subdirs
config.autoload_paths += Dir[Rails.root.join('app', 'models', '**/')]
config.autoload_paths << Rails.root.join('lib')
config.eager_load_paths << config.root.join('lib', 'validators')
config.watchable_dirs['lib'] = %i[rb]
# Add the fonts path
config.assets.paths << Rails.root.join('vendor', 'assets', 'fonts')

View file

@ -1,52 +1,28 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
# Configure static asset server for tests with Cache-Control for performance.
config.serve_static_files = true
config.static_cache_control = 'public, max-age=3600'
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
config.active_support.test_order = :random
ActiveSupport::Deprecation.silenced = true
# For rails-settings-cached conflict
config.cache_store = :file_store, 'tmp/cache_test'
config.active_support.deprecation = :raise
config.logger = ActiveSupport::Logger.new(nil)
config.action_view.raise_on_missing_translations = true
# The available log levels are: :debug, :info, :warn, :error, :fatal, and :unknown,
# corresponding to the log level numbers from 0 up to 5 respectively
config.log_level = :debug
config.active_job.queue_adapter = :test
config.logger = ActiveSupport::Logger.new(nil)
config.active_support.test_order = :random # :random is the default in Rails 5
# If set to :null_store, Setting.x returns nil after first spec runs (database is emptied)
config.cache_store = :memory_store
end
# In this mode, any jobs you queue will be run in the same thread, synchronously
# (that is, MyJob.enqueue runs the job and won't return until it's completed).
# This makes your application's behavior easier to test
Que.mode = :sync

View file

@ -1,23 +0,0 @@
# the following line is required for PaperTrail >= 4.0.0 with Rails
PaperTrail::Rails::Engine.eager_load!
PaperTrail::Version.module_eval do
self.abstract_class = true
end
# Store console and rake changes in versions
if defined?(::Rails::Console)
PaperTrail.whodunnit = "console-#{`whoami`.strip}"
elsif File.basename($PROGRAM_NAME) == "rake"
# rake username does not work when spring enabled
PaperTrail.whodunnit = "rake-#{`whoami`.strip} #{ARGV.join ' '}"
end
class PaperSession
class << self
attr_writer :session
def session
@session ||= Time.zone.now.to_s(:db)
end
end
end

View file

@ -1,5 +0,0 @@
class Array
def include_any? *args
(self & args).any?
end
end

View file

@ -1,3 +1,5 @@
require 'devise_custom_failure'
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|

View file

@ -0,0 +1,4 @@
require 'core_ext/array'
require 'gem_ext/builder'
require 'gem_ext/i18n'
require 'gem_ext/paper_trail'

View file

@ -51,8 +51,8 @@ if con.present? && con.table_exists?('settings')
Setting.save_default(:redemption_grace_period, 30)
Setting.save_default(:expiration_reminder_mail, 2)
Setting.save_default(:registrar_ip_whitelist_enabled, true)
Setting.save_default(:api_ip_whitelist_enabled, true)
Setting.save_default(:registrar_ip_whitelist_enabled, false)
Setting.save_default(:api_ip_whitelist_enabled, false)
Setting.save_default(:registry_juridical_name, 'Eesti Interneti SA')
Setting.save_default(:registry_reg_no, '90010019')

View file

@ -1 +0,0 @@
Dir[File.join(Rails.root, 'lib', 'ext', '*.rb')].each { |x| require x }

View file

@ -1,11 +0,0 @@
# Don't raise error when nil
# http://stackoverflow.com/questions/9467034/rails-i18n-how-to-handle-case-of-a-nil-date-being-passed-ie-lnil
module I18n
class << self
alias_method :original_localize, :localize
def localize(object, options = {})
object.present? ? original_localize(object, options) : ''
end
end
end

View file

@ -1,4 +1,4 @@
require 'epp_constraint'
require_dependency 'epp_constraint'
Rails.application.routes.draw do
namespace(:epp, defaults: { format: :xml }) do