fix emails
This commit is contained in:
parent
c8130f7e3f
commit
d573b8a421
@ -1,6 +1,7 @@
|
||||
# v0.1.16
|
||||
- Fix empty invite index page
|
||||
- Fix faq copy
|
||||
- Fix issue with emails
|
||||
- Update deps
|
||||
|
||||
# v0.1.15
|
||||
|
@ -32,4 +32,4 @@ config :logger, level: :warning
|
||||
config :phoenix, :plug_init_mode, :runtime
|
||||
|
||||
# Disable Oban
|
||||
config :memex, Oban, queues: false, plugins: false
|
||||
config :memex, Oban, queues: false, plugins: false, testing: :manual
|
||||
|
@ -66,12 +66,12 @@ msgstr ""
|
||||
msgid "Welcome to memEx"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex/accounts/email.ex:31
|
||||
#: lib/memex/email.ex:31
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
msgid "confirm your memEx account"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex/accounts/email.ex:37
|
||||
#: lib/memex/email.ex:37
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
msgid "reset your memEx password"
|
||||
msgstr ""
|
||||
@ -86,7 +86,7 @@ msgstr ""
|
||||
msgid "this email was sent from memEx at %{url}"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex/accounts/email.ex:43
|
||||
#: lib/memex/email.ex:43
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
msgid "update your memEx email"
|
||||
msgstr ""
|
||||
|
@ -66,12 +66,12 @@ msgstr ""
|
||||
msgid "Welcome to memEx"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex/accounts/email.ex:31
|
||||
#: lib/memex/email.ex:31
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "confirm your memEx account"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex/accounts/email.ex:37
|
||||
#: lib/memex/email.ex:37
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "reset your memEx password"
|
||||
msgstr ""
|
||||
@ -86,7 +86,7 @@ msgstr ""
|
||||
msgid "this email was sent from memEx at %{url}"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex/accounts/email.ex:43
|
||||
#: lib/memex/email.ex:43
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "update your memEx email"
|
||||
msgstr ""
|
||||
|
@ -67,12 +67,12 @@ msgstr ""
|
||||
msgid "Welcome to memEx"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex/accounts/email.ex:31
|
||||
#: lib/memex/email.ex:31
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
msgid "confirm your memEx account"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex/accounts/email.ex:37
|
||||
#: lib/memex/email.ex:37
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
msgid "reset your memEx password"
|
||||
msgstr ""
|
||||
@ -87,7 +87,7 @@ msgstr ""
|
||||
msgid "this email was sent from memEx at %{url}"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex/accounts/email.ex:43
|
||||
#: lib/memex/email.ex:43
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
msgid "update your memEx email"
|
||||
msgstr ""
|
||||
|
40
test/memex/email_worker_test.exs
Normal file
40
test/memex/email_worker_test.exs
Normal file
@ -0,0 +1,40 @@
|
||||
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
|
@ -38,8 +38,9 @@ defmodule Memex.Fixtures do
|
||||
def extract_user_token(fun) do
|
||||
%{args: %{attrs: attrs, email: email_key, user_id: user_id}} = fun.(&"[TOKEN]#{&1}[TOKEN]")
|
||||
|
||||
# convert atoms to string keys
|
||||
attrs = attrs |> Map.new(fn {atom_key, value} -> {atom_key |> Atom.to_string(), value} end)
|
||||
attrs =
|
||||
attrs
|
||||
|> Map.new(fn {key, value} -> {Atom.to_string(key), value} end)
|
||||
|
||||
email =
|
||||
email_key
|
||||
|
Loading…
Reference in New Issue
Block a user