diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/commands/dbconsole_test.rb | 6 | ||||
-rw-r--r-- | railties/test/generators/encrypted_secrets_generator_test.rb | 4 | ||||
-rw-r--r-- | railties/test/secrets_test.rb | 4 |
3 files changed, 10 insertions, 4 deletions
diff --git a/railties/test/commands/dbconsole_test.rb b/railties/test/commands/dbconsole_test.rb index e922a23e15..6ad96b28c7 100644 --- a/railties/test/commands/dbconsole_test.rb +++ b/railties/test/commands/dbconsole_test.rb @@ -206,6 +206,12 @@ class Rails::DBConsoleTest < ActiveSupport::TestCase assert_equal ["sqlplus", "user/secret@db"], dbconsole.find_cmd_and_exec_args end + def test_sqlserver + start(adapter: "sqlserver", database: "db", username: "user", password: "secret", host: "localhost", port: 1433) + assert_not aborted + assert_equal ["sqsh", "-D", "db", "-U", "user", "-P", "secret", "-S", "localhost:1433"], dbconsole.find_cmd_and_exec_args + end + def test_unknown_command_line_client start(adapter: "unknown", database: "db") assert aborted diff --git a/railties/test/generators/encrypted_secrets_generator_test.rb b/railties/test/generators/encrypted_secrets_generator_test.rb index 205827e498..eacb5166c0 100644 --- a/railties/test/generators/encrypted_secrets_generator_test.rb +++ b/railties/test/generators/encrypted_secrets_generator_test.rb @@ -17,8 +17,8 @@ class EncryptedSecretsGeneratorTest < Rails::Generators::TestCase assert_file "config/secrets.yml.key", /\w+/ assert File.exist?("config/secrets.yml.enc") - assert_no_match(/production:\n# external_api_key: \w+/, IO.binread("config/secrets.yml.enc")) - assert_match(/production:\n# external_api_key: \w+/, Rails::Secrets.read) + assert_no_match(/# production:\n# external_api_key: \w+/, IO.binread("config/secrets.yml.enc")) + assert_match(/# production:\n# external_api_key: \w+/, Rails::Secrets.read) end def test_appends_to_gitignore diff --git a/railties/test/secrets_test.rb b/railties/test/secrets_test.rb index 445e216f16..ff6f955a78 100644 --- a/railties/test/secrets_test.rb +++ b/railties/test/secrets_test.rb @@ -47,7 +47,7 @@ class Rails::SecretsTest < ActiveSupport::TestCase ENV["RAILS_MASTER_KEY"] = IO.binread("config/secrets.yml.key").strip FileUtils.rm("config/secrets.yml.key") - assert_match "production:\n# external_api_key", Rails::Secrets.read + assert_match "# production:\n# external_api_key:", Rails::Secrets.read ensure ENV["RAILS_MASTER_KEY"] = old_key end @@ -69,7 +69,7 @@ class Rails::SecretsTest < ActiveSupport::TestCase Rails::Secrets.read_for_editing do |tmp_path| decrypted_path = tmp_path - assert_match(/production:\n# external_api_key/, File.read(tmp_path)) + assert_match(/# production:\n# external_api_key/, File.read(tmp_path)) File.write(tmp_path, "Empty streets, empty nights. The Downtown Lights.") end |