Fix deprecation warnings from tests #3220
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have completed some work on Case Manager that's ready for review!
This pull request makes the following changes:
1) Set
action_dispatch.show_exceptions
to:none
The deprecation warning:
Setting action_dispatch.show_exceptions to false is deprecated. Set to :none instead. (called from block (4 levels) in class:LinesControllerTest at /home/runner/work/dcaf_case_management/dcaf_case_management/test/controllers/lines_controller_test.rb:34)
is due to a change in how Rails handles the
action_dispatch.show_exceptions
configuration setting.Setting it to
:none
will have the same effect as setting it tofalse
in the previous version.2) Conditional Secret Key Assignment for Test Environment
The secret key for Devise is now explicitly set to
Rails.application.secret_key_base
in test environments .This is a temporary workaround for the tests deprecation warning:
Rails.application.secrets is deprecated in favor of Rails.application.credentials and will be removed in Rails 7.2.
See related issue.Next Steps
As part of Rails' evolution, accessing secrets via
Rails.application.secrets
is being deprecated in favor ofRails.application.credentials
. This change aims to enhance security and streamline secret management by utilizing encrypted credentials.I would consider migrating all sensitive credentials from the unencrypted
secrets.yml
file to Rails' encrypted credentials system (credentials.yml.enc
). I can do this on this PR and share the necessary master key securely via SendSafely with a team member who has the requisite Heroku access. This will allow us to set up the environment variables on Heroku securely and complete the migration process.It relates to the following issue #s:
For reviewer:
feature
if it contains a feature, fix, or similar. This is anything that contains a user-facing fix in some way, such as frontend changes, alterations to backend behavior, or bug fixes.dependencies
if it contains library upgrades or similar. This is anything that upgrades any dependency, such as a Gemfile update or npm package upgrade.