From: Ekaterina Vaartis Date: Sat, 15 Dec 2018 19:38:39 +0000 (+0300) Subject: Add a captcha mock for tests X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=e8537208bd9af701cbfc788ca307b8352306a36b;p=akkoma Add a captcha mock for tests --- diff --git a/config/test.exs b/config/test.exs index 5c6acfead..f5348bd46 100644 --- a/config/test.exs +++ b/config/test.exs @@ -6,6 +6,11 @@ config :pleroma, Pleroma.Web.Endpoint, http: [port: 4001], server: false +# Disable captha for tests +config :pleroma, Pleroma.Captcha, + enabled: true, + method: Pleroma.Captcha.Mock # A fake captcha service for tests + # Print only warnings and errors during test config :logger, level: :warn diff --git a/test/support/captcha_mock.ex b/test/support/captcha_mock.ex new file mode 100644 index 000000000..9d79f2e95 --- /dev/null +++ b/test/support/captcha_mock.ex @@ -0,0 +1,10 @@ +defmodule Pleroma.Captcha.Mock do + alias Pleroma.Captcha.Service + @behaviour Service + + @impl Service + def new(), do: %{type: :mock} + + @impl Service + def validate(_token, _captcha), do: true +end