Skip to content

Commit f07cf77

Browse files
committed
add coverage for nil name checker and update model to use name
1 parent 195a634 commit f07cf77

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/lib/code_corps/emails/receipt_email_test.exs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ defmodule CodeCorps.Emails.ReceiptEmailTest do
44

55
alias CodeCorps.Emails.ReceiptEmail
66

7+
8+
test "get name returns there on nil name" do
9+
user = %CodeCorps.User{}
10+
assert ReceiptEmail.get_name(user) == "there"
11+
end
12+
713
test "receipt email works" do
814
invoice_fixture = CodeCorps.StripeTesting.Helpers.load_fixture("invoice")
915

@@ -50,7 +56,7 @@ defmodule CodeCorps.Emails.ReceiptEmailTest do
5056
project_url: "http://localhost:4200/#{project.organization.slug}/#{project.slug}",
5157
project_current_donation_goal_description: "Test goal",
5258
subject: "Your monthly donation to Code Corps",
53-
user_first_name: "Jimmy"
59+
name: "Jimmy"
5460
}
5561
assert high_five_image_url
5662
end

0 commit comments

Comments
 (0)