aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/multiple_applications_test.rb
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2018-09-24 14:07:32 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2019-01-14 20:13:00 +0100
commit37c948ce6715df8ecbcda2b64a1e6eee9c5d6bb6 (patch)
tree82478e0ca821b42b3cdc63d22a50da70f4ba4473 /railties/test/application/multiple_applications_test.rb
parent3631d7eee4bd034f2eefe1b9892d5fcd565579ac (diff)
downloadrails-37c948ce6715df8ecbcda2b64a1e6eee9c5d6bb6.tar.gz
rails-37c948ce6715df8ecbcda2b64a1e6eee9c5d6bb6.tar.bz2
rails-37c948ce6715df8ecbcda2b64a1e6eee9c5d6bb6.zip
Restructure credentials after environment overrides.
Follow up to: e0d3313 - Revert renames from `encrypted` and `encrypted_file` back to `credentials`. They might be using our Encrypted* generators but from that level of abstraction they're still about credentials. - Same vein: extract a `credentials` method for the `encrypted` local variable. But don't call it `encrypted` just because it uses that under the hood. It's about capturing the credentials. It's also useful in `change_credentials_in_system_editor`. - Remove lots of needless argument passing. We've abstracted content_path and key_path into methods for a reason, so they should be used. Also spares a conspicuous rename of content_path into file_path in other methods. - Reorders private methods so they're grouped into: command building blocks, option parsers, and the generators. - Extracts commonality in the credentials application tests. A tad unsure about this. But I do like that we go with key, content thus matching the command and remove the yield which isn't really needed. - Moves test/credentials_test.rb to beneath the test/application directory. It's a Rails application test, so it should be in there. - Uses `root.join` — a neat trick gleaned from the tests! — and composes the configuration private methods such that the building block is below the callers.
Diffstat (limited to 'railties/test/application/multiple_applications_test.rb')
-rw-r--r--railties/test/application/multiple_applications_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/test/application/multiple_applications_test.rb b/railties/test/application/multiple_applications_test.rb
index d6c81c1fe2..432344bccc 100644
--- a/railties/test/application/multiple_applications_test.rb
+++ b/railties/test/application/multiple_applications_test.rb
@@ -165,12 +165,12 @@ module ApplicationTests
app.config.some_setting = "a_different_setting"
assert_equal "a_different_setting", app.config.some_setting, "The configuration's some_setting should be set."
- new_config = Rails::Application::Configuration.new("root_of_application")
+ new_config = Rails::Application::Configuration.new(Pathname.new("root_of_application"))
new_config.some_setting = "some_setting_dude"
app.config = new_config
assert_equal "some_setting_dude", app.config.some_setting, "The configuration's some_setting should have changed."
- assert_equal "root_of_application", app.config.root, "The root should have changed to the new config's root."
+ assert_equal "root_of_application", app.config.root.to_s, "The root should have changed to the new config's root."
assert_equal new_config, app.config, "The application's config should have changed to the new config."
end
end