1 defmodule Pleroma.CaptchaTest do
6 @ets_options [:ordered_set, :private, :named_table, {:read_concurrency, true}]
8 describe "Kocaptcha" do
10 ets_name = Pleroma.Captcha.Kocaptcha.Ets
11 ^ets_name = :ets.new(ets_name, @ets_options)
14 %{method: :get, url: "http://localhost:9093/new"} ->
16 md5: "63615261b77f5354fb8c4e4986477555",
17 token: "afa1815e14e29355e6c8f6b143a39fa2",
18 url: "/captchas/afa1815e14e29355e6c8f6b143a39fa2.png"
25 test "new and validate" do
26 assert Pleroma.Captcha.Kocaptcha.new() == %{
28 token: "afa1815e14e29355e6c8f6b143a39fa2",
29 url: "http://localhost:9093/captchas/afa1815e14e29355e6c8f6b143a39fa2.png"
32 assert Pleroma.Captcha.Kocaptcha.validate(
33 "afa1815e14e29355e6c8f6b143a39fa2",