Skip to content

Commit 9c7eef9

Browse files
RandomTannenbaumManuelMoeri
authored andcommitted
Update json fixtures and use full_name instead of interpolating it
1 parent 95ce74d commit 9c7eef9

File tree

3 files changed

+46
-35
lines changed

3 files changed

+46
-35
lines changed

Diff for: app/domain/ptime/assign_employee_ids.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ def map_employees(should_map)
2424
mapped_people_count = 0
2525

2626
@ptime_employees.each do |ptime_employee|
27-
ptime_employee_name =
28-
"#{ptime_employee[:attributes][:firstname]} #{ptime_employee[:attributes][:lastname]}"
27+
ptime_employee_name = ptime_employee[:attributes][:full_name]
2928
ptime_employee_email = ptime_employee[:attributes][:email]
3029
matched_person = Person.where(ptime_employee_id: nil).find_by(email: ptime_employee_email)
3130

Diff for: spec/fixtures/files/json/all_ptime_employees.json

+39-31
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,57 @@
44
"id" : 33,
55
"type" : "employee",
66
"attributes" : {
7-
"shortname" : "LSM",
8-
"firstname" : "Longmax",
9-
"lastname" : "Smith",
10-
"email" : "[email protected]",
11-
"marital_status" : "single",
12-
"nationalities" : ["ZW"],
13-
"graduation" : "BSc in Architecture",
14-
"department_shortname" : "SYS",
15-
"employment_roles" : []
7+
"shortname" : "LSM",
8+
"firstname" : "Longmax",
9+
"lastname" : "Smith",
10+
"full_name": "Longmax Smith",
11+
"email" : "[email protected]",
12+
"marital_status" : "single",
13+
"nationalities" : ["ZW"],
14+
"graduation" : "BSc in Architecture",
15+
"department_shortname" : "SYS",
16+
"employment_roles" : [],
17+
"is_employed" : true,
18+
"birthdate" : "05.05.1994",
19+
"location" : "Bern"
1620
}
1721
},
1822
{
1923
"id" : 21,
2024
"type" : "employee",
2125
"attributes" : {
22-
"shortname" : "AMA",
23-
"firstname" : "Alice",
24-
"lastname" : "Mante",
25-
"full_name" : "Alice Mante",
26-
"email" : "[email protected]",
27-
"marital_status" : "single",
28-
"nationalities" : ["AU"],
29-
"graduation" : "MSc in writing",
30-
"department_shortname" : "SYS",
31-
"employment_roles" : [],
32-
"is_employed" : false,
33-
"birthdate" : "01.04.2001",
34-
"location" : "Bern"
26+
"shortname" : "AMA",
27+
"firstname" : "Alice",
28+
"lastname" : "Mante",
29+
"full_name" : "Alice Mante",
30+
"email" : "[email protected]",
31+
"marital_status" : "single",
32+
"nationalities" : ["AU"],
33+
"graduation" : "MSc in writing",
34+
"department_shortname" : "SYS",
35+
"employment_roles" : [],
36+
"is_employed" : false,
37+
"birthdate" : "01.04.2001",
38+
"location" : "Bern"
3539
}
3640
},
3741
{
3842
"id" : 45,
3943
"type" : "employee",
4044
"attributes" : {
41-
"shortname" : "CFO",
42-
"firstname" : "Charlie",
43-
"lastname" : "Ford",
44-
"email" : "[email protected]",
45-
"marital_status" : "married",
46-
"nationalities" : ["GB"],
47-
"graduation" : "MSc in networking",
48-
"department_shortname" : "SYS",
49-
"employment_roles" : []
45+
"shortname" : "CFO",
46+
"firstname" : "Charlie",
47+
"lastname" : "Ford",
48+
"full_name": "Charlie Ford",
49+
"email" : "[email protected]",
50+
"marital_status" : "married",
51+
"nationalities" : ["GB"],
52+
"graduation" : "MSc in networking",
53+
"department_shortname" : "SYS",
54+
"employment_roles" : [],
55+
"is_employed" : true,
56+
"birthdate" : "01.10.1980",
57+
"location" : "Thun"
5058
}
5159
}
5260
]

Diff for: spec/fixtures/files/json/new_ptime_employee.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@
77
"shortname": "PFI",
88
"firstname": "Peterson",
99
"lastname": "Findus",
10+
"full_name": "Peterson Findus",
1011
"email": "[email protected]",
1112
"marital_status": "single",
1213
"nationalities": [
1314
"ZW"
1415
],
1516
"graduation": "Cat caretaker",
1617
"department_shortname": "CAT",
17-
"employment_roles": []
18+
"employment_roles": [],
19+
"is_employed" : true,
20+
"birthdate" : "12.12.1958",
21+
"location" : "Bern"
1822
}
1923
}
2024
]
21-
}
25+
}

0 commit comments

Comments
 (0)