Fix config test: clear vereinfacht_app_url from settings so derived URL is used
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
68e6c74a67
commit
fd6301efab
1 changed files with 14 additions and 1 deletions
|
|
@ -40,6 +40,8 @@ defmodule Mv.ConfigVereinfachtTest do
|
|||
end
|
||||
|
||||
test "returns app contact view URL when API URL is set (derived app URL)" do
|
||||
clear_vereinfacht_env()
|
||||
clear_vereinfacht_app_url_from_settings()
|
||||
set_vereinfacht_env("VEREINFACHT_API_URL", "https://api.example.com/api/v1")
|
||||
|
||||
assert Mv.Config.vereinfacht_contact_view_url("42") ==
|
||||
|
|
@ -54,7 +56,7 @@ defmodule Mv.ConfigVereinfachtTest do
|
|||
assert Mv.Config.vereinfacht_contact_view_url("abc") ==
|
||||
"https://app.verein.visuel.dev/en/admin/finances/contacts/abc"
|
||||
after
|
||||
System.delete_env("VEREINFACHT_APP_URL")
|
||||
clear_vereinfacht_env()
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -66,5 +68,16 @@ defmodule Mv.ConfigVereinfachtTest do
|
|||
System.delete_env("VEREINFACHT_API_URL")
|
||||
System.delete_env("VEREINFACHT_API_KEY")
|
||||
System.delete_env("VEREINFACHT_CLUB_ID")
|
||||
System.delete_env("VEREINFACHT_APP_URL")
|
||||
end
|
||||
|
||||
defp clear_vereinfacht_app_url_from_settings do
|
||||
case Mv.Membership.get_settings() do
|
||||
{:ok, settings} ->
|
||||
Mv.Membership.update_settings(settings, %{vereinfacht_app_url: nil})
|
||||
|
||||
_ ->
|
||||
:ok
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue