WIP set the environment variable
next: implement
This commit is contained in:
parent
09aeb31cb3
commit
1c23e93d43
@ -2,7 +2,16 @@ defmodule BasicSignupWhitelistTest do
|
|||||||
use ExUnit.Case
|
use ExUnit.Case
|
||||||
doctest BasicSignupWhitelist
|
doctest BasicSignupWhitelist
|
||||||
|
|
||||||
|
defp allow_signups_for(whitelist) do
|
||||||
|
System.put_env("SIGNUP_ALLOWED_EMAILS", whitelist)
|
||||||
|
end
|
||||||
|
|
||||||
test "When not set, not whitelisted" do
|
test "When not set, not whitelisted" do
|
||||||
assert BasicSignupWhitelist.mail_whitelisted("joe@example.com") == false
|
refute BasicSignupWhitelist.mail_whitelisted("joe@example.com")
|
||||||
|
end
|
||||||
|
|
||||||
|
test "When set to star, whitelisted" do
|
||||||
|
allow_signups_for("*")
|
||||||
|
assert BasicSignupWhitelist.mail_whitelisted("joe@example.com")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user