memEx/test/memex/email_worker_test.exs

41 lines
900 B
Elixir
Raw Permalink Normal View History

2024-07-28 13:00:53 -04:00
defmodule Memex.EmailWorkerTest do
use Memex.DataCase, async: true
def perform_job(worker, args) do
Oban.Testing.perform_job(worker, args, [])
end
test "sending welcome email" do
user = user_fixture()
{:ok, _user} =
perform_job(Memex.EmailWorker, %{
"email" => "welcome",
"user_id" => user.id,
"attrs" => %{"url" => "test_url"}
})
end
test "sending reset password email" do
user = user_fixture()
{:ok, _user} =
perform_job(Memex.EmailWorker, %{
"email" => "reset_password",
"user_id" => user.id,
"attrs" => %{"url" => "test_url"}
})
end
test "sending update email email" do
user = user_fixture()
{:ok, _user} =
perform_job(Memex.EmailWorker, %{
"email" => "update_email",
"user_id" => user.id,
"attrs" => %{"url" => "test_url"}
})
end
end