|
|
|
@ -28,6 +28,18 @@ defmodule Explorer.Repo.ConfigHelperTest do |
|
|
|
|
assert result[:database] == "test_database" |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
test "parse params from database url with hyphen in databasename" do |
|
|
|
|
database_url = "postgresql://test_username:test_password@host-name.test.com:7777/test-database" |
|
|
|
|
|
|
|
|
|
result = ConfigHelper.get_db_config(%{url: database_url, env_func: fn _ -> nil end}) |
|
|
|
|
|
|
|
|
|
assert result[:username] == "test_username" |
|
|
|
|
assert result[:password] == "test_password" |
|
|
|
|
assert result[:hostname] == "host-name.test.com" |
|
|
|
|
assert result[:port] == "7777" |
|
|
|
|
assert result[:database] == "test-database" |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
test "parse params from database url with special characters in password" do |
|
|
|
|
database_url = "postgresql://test_username:awN!l#W*g$P%t-l^q&d@hostname.test.com:7777/test_database" |
|
|
|
|
|
|
|
|
|