Move mailer from Bamboo to Swoosh
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
|
||||
use Mobilizon.Web.ConnCase
|
||||
use Bamboo.Test
|
||||
use Mobilizon.Tests.Helpers
|
||||
|
||||
alias Mobilizon.Config
|
||||
@@ -8,9 +7,9 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
|
||||
alias Mobilizon.Events.{Event, EventParticipantStats, Participant}
|
||||
alias Mobilizon.GraphQL.AbsintheHelpers
|
||||
alias Mobilizon.Storage.Page
|
||||
alias Mobilizon.Web.Email
|
||||
|
||||
import Mobilizon.Factory
|
||||
import Swoosh.TestAssertions
|
||||
|
||||
@event %{
|
||||
description: "some body",
|
||||
@@ -720,9 +719,9 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
|
||||
assert json_response(res, 200)["data"]["updateParticipation"]["actor"]["id"] ==
|
||||
to_string(actor.id)
|
||||
|
||||
participation = Events.get_participant(participation_id)
|
||||
assert %Participant{} = Events.get_participant(participation_id)
|
||||
|
||||
assert_delivered_email(Email.Participation.participation_updated(user, participation))
|
||||
assert_email_sent(to: user.email)
|
||||
|
||||
res =
|
||||
conn
|
||||
@@ -864,8 +863,8 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
|
||||
assert json_response(res, 200)["data"]["updateParticipation"]["actor"]["id"] ==
|
||||
to_string(actor.id)
|
||||
|
||||
participation = Events.get_participant(participation_id)
|
||||
assert_delivered_email(Email.Participation.participation_updated(user, participation))
|
||||
assert %Participant{} = Events.get_participant(participation_id)
|
||||
assert_email_sent(to: user.email)
|
||||
|
||||
res =
|
||||
conn
|
||||
@@ -1112,12 +1111,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
|
||||
assert %Participant{
|
||||
metadata: %{confirmation_token: confirmation_token},
|
||||
role: :not_confirmed
|
||||
} =
|
||||
participant =
|
||||
event.id |> Events.list_participants_for_event([]) |> Map.get(:elements) |> hd()
|
||||
|
||||
# hack to avoid preloading event in participant
|
||||
participant = Map.put(participant, :event, event)
|
||||
} = event.id |> Events.list_participants_for_event([]) |> Map.get(:elements) |> hd()
|
||||
|
||||
res =
|
||||
conn
|
||||
@@ -1128,9 +1122,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
|
||||
|
||||
assert hd(res["errors"])["message"] == "You are already a participant of this event"
|
||||
|
||||
assert_delivered_email(
|
||||
Email.Participation.anonymous_participation_confirmation(@email, participant)
|
||||
)
|
||||
assert_email_sent(to: @email)
|
||||
|
||||
res =
|
||||
conn
|
||||
@@ -1142,10 +1134,9 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
|
||||
assert is_nil(res["errors"])
|
||||
|
||||
assert %Participant{role: :participant} =
|
||||
participant =
|
||||
event.id |> Events.list_participants_for_event() |> Map.get(:elements) |> hd()
|
||||
|
||||
assert_delivered_email(Email.Participation.participation_updated(@email, participant))
|
||||
assert_email_sent(to: @email)
|
||||
end
|
||||
|
||||
test "I can participate anonymously and and confirm my participation with bad token",
|
||||
@@ -1377,8 +1368,8 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
|
||||
}
|
||||
}} = Events.get_event(event.id)
|
||||
|
||||
participant = Events.get_participant(participant_id)
|
||||
assert_delivered_email(Email.Participation.participation_updated(@email, participant))
|
||||
assert %Participant{} = Events.get_participant(participant_id)
|
||||
assert_email_sent(to: @email)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user