-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Employee): Use official's email address if names are blank (#140)
- Loading branch information
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,18 @@ defmodule Orbit.EmployeeTest do | |
|
||
assert Employee.display_name(employee) == "First Name" | ||
end | ||
|
||
test "uses email if names are all blank" do | ||
employee = | ||
build(:employee, %{ | ||
preferred_first: nil, | ||
first_name: "", | ||
last_name: "", | ||
email: "[email protected]" | ||
}) | ||
|
||
assert Employee.display_name(employee) == "[email protected]" | ||
end | ||
end | ||
|
||
describe "get_by_badge_serial/1" do | ||
|