This repository has been archived by the owner on Nov 27, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This new environment will be used for smoke testing only. E.g. RAILS_ENV=smoke_test TEST_URL=... bundle exec rake spec:features A new environment is required since RSpec requires a DB to be running and connected to in order to run the tests. We could delete the constant ActiveRecord e.g. Object.send(:remove_const, :ActiveRecord), but I decided to use a new env that doesn't load it instead. Alternative approaches: - We could use https://github.com/nulldb/nulldb rather than not requiring ActiveRecord - There might be a way to use rspec/rspec-rails#2266 but I don't think it helps our situations, since we do need ActiveRecord.
- Loading branch information
Bill Franklin
committed
Apr 14, 2020
1 parent
f334af7
commit c1e50c5
Showing
6 changed files
with
62 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# frozen_string_literal: 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! | ||
|
||
Rails.application.configure do | ||
# Settings specified here will take precedence over those in | ||
# config/application.rb. | ||
|
||
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 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. | ||
config.consider_all_requests_local = true | ||
config.action_controller.perform_caching = false | ||
config.cache_store = :null_store | ||
|
||
# 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 | ||
|
||
# Print deprecation notices to the stderr. | ||
config.active_support.deprecation = :stderr | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters