projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Credo fixes.
[akkoma]
/
test
/
captcha_test.exs
diff --git
a/test/captcha_test.exs
b/test/captcha_test.exs
index ac1d846e833f7d2f19e281b8e3cdd139afae318c..1ab9019ab756d4caee7d46463f31566d6c730901 100644
(file)
--- a/
test/captcha_test.exs
+++ b/
test/captcha_test.exs
@@
-61,7
+61,7
@@
defmodule Pleroma.CaptchaTest do
assert is_binary(answer)
assert :ok = Native.validate(token, answer, answer)
assert is_binary(answer)
assert :ok = Native.validate(token, answer, answer)
- assert {:error,
"Invalid CAPTCHA"
} == Native.validate(token, answer, answer <> "foobar")
+ assert {:error,
:invalid
} == Native.validate(token, answer, answer <> "foobar")
end
end
end
end
@@
-78,6
+78,7
@@
defmodule Pleroma.CaptchaTest do
assert is_binary(answer)
assert :ok = Captcha.validate(token, "63615261b77f5354fb8c4e4986477555", answer)
assert is_binary(answer)
assert :ok = Captcha.validate(token, "63615261b77f5354fb8c4e4986477555", answer)
+ Cachex.del(:used_captcha_cache, token)
end
test "doesn't validate invalid answer" do
end
test "doesn't validate invalid answer" do
@@
-92,7
+93,7
@@
defmodule Pleroma.CaptchaTest do
assert is_binary(answer)
assert is_binary(answer)
- assert {:error,
"Invalid answer data"
} =
+ assert {:error,
:invalid_answer_data
} =
Captcha.validate(token, "63615261b77f5354fb8c4e4986477555", answer <> "foobar")
end
Captcha.validate(token, "63615261b77f5354fb8c4e4986477555", answer <> "foobar")
end
@@
-108,7
+109,7
@@
defmodule Pleroma.CaptchaTest do
assert is_binary(answer)
assert is_binary(answer)
- assert {:error,
"Invalid answer data"
} =
+ assert {:error,
:invalid_answer_data
} =
Captcha.validate(token, "63615261b77f5354fb8c4e4986477555", nil)
end
end
Captcha.validate(token, "63615261b77f5354fb8c4e4986477555", nil)
end
end