1 defmodule Pleroma.CaptchaTest do
6 alias Pleroma.Captcha.Kocaptcha
8 @ets_options [:ordered_set, :private, :named_table, {:read_concurrency, true}]
10 describe "Kocaptcha" do
12 ets_name = Kocaptcha.Ets
13 ^ets_name = :ets.new(ets_name, @ets_options)
16 %{method: :get, url: "https://captcha.kotobank.ch/new"} ->
18 md5: "63615261b77f5354fb8c4e4986477555",
19 token: "afa1815e14e29355e6c8f6b143a39fa2",
20 url: "/captchas/afa1815e14e29355e6c8f6b143a39fa2.png"
27 test "new and validate" do
29 assert new[:type] == :kocaptcha
30 assert new[:token] == "afa1815e14e29355e6c8f6b143a39fa2"
33 "https://captcha.kotobank.ch/captchas/afa1815e14e29355e6c8f6b143a39fa2.png"
35 assert Kocaptcha.validate(