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