File tree Expand file tree Collapse file tree 3 files changed +9
-15
lines changed
test/lib/code_corps/emails/transmissions Expand file tree Collapse file tree 3 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ defmodule CodeCorps.Emails.Transmissions.ProjectApprovalRequestTest do
2525 admin_1 = insert ( :user , admin: true )
2626 admin_2 = insert ( :user , admin: true )
2727
28- % { substitution_data: data , recipients: [ recipient_1 , recipient_2 ] } =
28+ % { substitution_data: data , recipients: recipients } =
2929 ProjectApprovalRequest . build ( project )
3030
3131 assert data . from_name == "Code Corps"
@@ -38,10 +38,8 @@ defmodule CodeCorps.Emails.Transmissions.ProjectApprovalRequestTest do
3838 assert data . project_url == "http://localhost:4200/#{ project . organization . slug } /#{ project . slug } "
3939 assert data . subject == "#{ project . title } is asking to be approved"
4040
41- assert recipient_1 . address . email == admin_1 . email
42- assert recipient_1 . address . name == admin_1 . first_name
43- assert recipient_2 . address . email == admin_2 . email
44- assert recipient_2 . address . name == admin_2 . first_name
41+ assert % { address: % { email: admin_1 . email , name: admin_1 . first_name } } in recipients
42+ assert % { address: % { email: admin_2 . email , name: admin_2 . first_name } } in recipients
4543 end
4644 end
4745end
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ defmodule CodeCorps.Emails.Transmissions.ProjectApprovedTest do
2424 % { user: owner_1 } = insert ( :project_user , project: project , role: "owner" )
2525 % { user: owner_2 } = insert ( :project_user , project: project , role: "owner" )
2626
27- % { substitution_data: data , recipients: [ recipient_1 , recipient_2 ] } =
27+ % { substitution_data: data , recipients: recipients } =
2828 ProjectApproved . build ( project )
2929
3030 assert data . from_name == "Code Corps"
@@ -34,10 +34,8 @@ defmodule CodeCorps.Emails.Transmissions.ProjectApprovedTest do
3434 assert data . project_url == "http://localhost:4200/#{ project . organization . slug } /#{ project . slug } "
3535 assert data . subject == "#{ project . title } is approved!"
3636
37- assert recipient_1 . address . email == owner_1 . email
38- assert recipient_1 . address . name == owner_1 . first_name
39- assert recipient_2 . address . email == owner_2 . email
40- assert recipient_2 . address . name == owner_2 . first_name
37+ assert % { address: % { email: owner_1 . email , name: owner_1 . first_name } } in recipients
38+ assert % { address: % { email: owner_2 . email , name: owner_2 . first_name } } in recipients
4139 end
4240 end
4341end
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ defmodule CodeCorps.Emails.Transmissions.ProjectUserRequestTest do
2626 % { user: owner_1 } = insert ( :project_user , project: project , role: "owner" )
2727 % { user: owner_2 } = insert ( :project_user , project: project , role: "owner" )
2828
29- % { substitution_data: data , recipients: [ recipient_1 , recipient_2 ] } =
29+ % { substitution_data: data , recipients: recipients } =
3030 ProjectUserRequest . build ( project_user )
3131
3232 assert data . from_name == "Code Corps"
@@ -39,10 +39,8 @@ defmodule CodeCorps.Emails.Transmissions.ProjectUserRequestTest do
3939 assert data . user_first_name == requesting_user . first_name
4040 assert data . subject == "#{ requesting_user . first_name } wants to join #{ project . title } "
4141
42- assert recipient_1 . address . email == owner_1 . email
43- assert recipient_1 . address . name == owner_1 . first_name
44- assert recipient_2 . address . email == owner_2 . email
45- assert recipient_2 . address . name == owner_2 . first_name
42+ assert % { address: % { email: owner_1 . email , name: owner_1 . first_name } } in recipients
43+ assert % { address: % { email: owner_2 . email , name: owner_2 . first_name } } in recipients
4644 end
4745 end
4846end
You can’t perform that action at this time.
0 commit comments