1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00

Adjust email and test for subject

This commit is contained in:
Daniel Barber 2018-08-15 14:46:32 -04:00
parent 2bf71e882f
commit 95b565231a
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
2 changed files with 7 additions and 6 deletions

View File

@ -6,12 +6,12 @@ defmodule Chess.Emails do
def new_game_email(conn, game) do
new_email()
|> to(game.opponent)
|> from("games@64squares.club")
|> subject("New chess game created!")
|> from({"64squares", "games@64squares.club"})
|> subject(
"[64squares] #{game.user.name} has invited you to play a game of chess."
)
|> text_body("""
#{game.user.name} has invited you to play a game of chess.
#{ChessWeb.Router.Helpers.game_url(conn, :show, game)}
Game link: #{ChessWeb.Router.Helpers.game_url(conn, :show, game)}
""")
end
end

View File

@ -45,7 +45,8 @@ defmodule ChessWeb.GameControllerTest do
|> post(game_path(conn, :create), game: attrs)
assert_email_delivered_with(
to: [{opponent.name, opponent.email}]
to: [{opponent.name, opponent.email}],
subject: "[64squares] #{user.name} has invited you to play a game of chess."
)
end