|
|
@ -1,32 +1,25 @@
|
|
|
|
require 'active_support/core_ext/integer/time'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 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!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rails.application.configure do
|
|
|
|
Rails.application.configure do
|
|
|
|
# Settings specified here will take precedence over those in config/application.rb.
|
|
|
|
# Settings specified here will take precedence over those in config/application.rb.
|
|
|
|
|
|
|
|
|
|
|
|
# Turn false under Spring and add config.action_view.cache_template_loading = true.
|
|
|
|
# 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
|
|
|
|
config.cache_classes = true
|
|
|
|
|
|
|
|
|
|
|
|
# Eager loading loads your whole application. When running a single test locally,
|
|
|
|
# Do not eager load code on boot. This avoids loading your whole application
|
|
|
|
# this probably isn't necessary. It's a good idea to do in a continuous integration
|
|
|
|
# just for the purpose of running a single test. If you are using a tool that
|
|
|
|
# system, or in some way before deploying your code.
|
|
|
|
# preloads Rails for running tests, you may have to set it to true.
|
|
|
|
config.eager_load = ENV['CI'].present?
|
|
|
|
config.eager_load = false
|
|
|
|
|
|
|
|
|
|
|
|
config.assets_digest = false
|
|
|
|
config.assets.digest = false
|
|
|
|
|
|
|
|
|
|
|
|
# Configure public file server for tests with Cache-Control for performance.
|
|
|
|
|
|
|
|
config.public_file_server.enabled = true
|
|
|
|
|
|
|
|
config.public_file_server.headers = {
|
|
|
|
|
|
|
|
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Show full error reports and disable caching.
|
|
|
|
# Show full error reports and disable caching.
|
|
|
|
config.consider_all_requests_local = true
|
|
|
|
config.consider_all_requests_local = true
|
|
|
|
config.action_controller.perform_caching = false
|
|
|
|
config.action_controller.perform_caching = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# The default store, file_store is shared by processes parallelly executed
|
|
|
|
|
|
|
|
# and should not be used.
|
|
|
|
config.cache_store = :memory_store
|
|
|
|
config.cache_store = :memory_store
|
|
|
|
|
|
|
|
|
|
|
|
# Raise exceptions instead of rendering exception templates.
|
|
|
|
# Raise exceptions instead of rendering exception templates.
|
|
|
@ -34,7 +27,6 @@ Rails.application.configure do
|
|
|
|
|
|
|
|
|
|
|
|
# Disable request forgery protection in test environment.
|
|
|
|
# Disable request forgery protection in test environment.
|
|
|
|
config.action_controller.allow_forgery_protection = false
|
|
|
|
config.action_controller.allow_forgery_protection = false
|
|
|
|
|
|
|
|
|
|
|
|
config.action_mailer.perform_caching = false
|
|
|
|
config.action_mailer.perform_caching = false
|
|
|
|
|
|
|
|
|
|
|
|
config.action_mailer.default_options = { from: 'notifications@localhost' }
|
|
|
|
config.action_mailer.default_options = { from: 'notifications@localhost' }
|
|
|
@ -54,8 +46,8 @@ Rails.application.configure do
|
|
|
|
config.x.vapid_private_key = vapid_key.private_key
|
|
|
|
config.x.vapid_private_key = vapid_key.private_key
|
|
|
|
config.x.vapid_public_key = vapid_key.public_key
|
|
|
|
config.x.vapid_public_key = vapid_key.public_key
|
|
|
|
|
|
|
|
|
|
|
|
# Raise exceptions for disallowed deprecations.
|
|
|
|
# Raises error for missing translations
|
|
|
|
config.active_support.disallowed_deprecation = :raise
|
|
|
|
# config.action_view.raise_on_missing_translations = true
|
|
|
|
|
|
|
|
|
|
|
|
config.i18n.default_locale = :en
|
|
|
|
config.i18n.default_locale = :en
|
|
|
|
config.i18n.fallbacks = true
|
|
|
|
config.i18n.fallbacks = true
|
|
|
@ -65,15 +57,6 @@ Rails.application.configure do
|
|
|
|
# Ref: https://github.com/mastodon/mastodon/issues/23644
|
|
|
|
# Ref: https://github.com/mastodon/mastodon/issues/23644
|
|
|
|
10.times { |i| Status.allocate.instance_variable_set(:"@ivar_#{i}", nil) }
|
|
|
|
10.times { |i| Status.allocate.instance_variable_set(:"@ivar_#{i}", nil) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# Tell Active Support which deprecation messages to disallow.
|
|
|
|
|
|
|
|
config.active_support.disallowed_deprecation_warnings = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Raises error for missing translations.
|
|
|
|
|
|
|
|
# config.i18n.raise_on_missing_translations = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Annotate rendered view with file names.
|
|
|
|
|
|
|
|
# config.action_view.annotate_rendered_view_with_filenames = true
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
Paperclip::Attachment.default_options[:path] = Rails.root.join('spec', 'test_files', ':class', ':id_partition', ':style.:extension')
|
|
|
|
Paperclip::Attachment.default_options[:path] = Rails.root.join('spec', 'test_files', ':class', ':id_partition', ':style.:extension')
|
|
|
|