Skip to content

Commit

Permalink
Update json fixtures and use full_name instead of interpolating it
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomTannenbaum authored and ManuelMoeri committed Feb 6, 2025
1 parent 95ce74d commit 9c7eef9
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 35 deletions.
3 changes: 1 addition & 2 deletions app/domain/ptime/assign_employee_ids.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ def map_employees(should_map)
mapped_people_count = 0

@ptime_employees.each do |ptime_employee|
ptime_employee_name =
"#{ptime_employee[:attributes][:firstname]} #{ptime_employee[:attributes][:lastname]}"
ptime_employee_name = ptime_employee[:attributes][:full_name]
ptime_employee_email = ptime_employee[:attributes][:email]
matched_person = Person.where(ptime_employee_id: nil).find_by(email: ptime_employee_email)

Expand Down
70 changes: 39 additions & 31 deletions spec/fixtures/files/json/all_ptime_employees.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,57 @@
"id" : 33,
"type" : "employee",
"attributes" : {
"shortname" : "LSM",
"firstname" : "Longmax",
"lastname" : "Smith",
"email" : "longmax@example.com",
"marital_status" : "single",
"nationalities" : ["ZW"],
"graduation" : "BSc in Architecture",
"department_shortname" : "SYS",
"employment_roles" : []
"shortname" : "LSM",
"firstname" : "Longmax",
"lastname" : "Smith",
"full_name": "Longmax Smith",
"email" : "longmax@example.com",
"marital_status" : "single",
"nationalities" : ["ZW"],
"graduation" : "BSc in Architecture",
"department_shortname" : "SYS",
"employment_roles" : [],
"is_employed" : true,
"birthdate" : "05.05.1994",
"location" : "Bern"
}
},
{
"id" : 21,
"type" : "employee",
"attributes" : {
"shortname" : "AMA",
"firstname" : "Alice",
"lastname" : "Mante",
"full_name" : "Alice Mante",
"email" : "alice@example.com",
"marital_status" : "single",
"nationalities" : ["AU"],
"graduation" : "MSc in writing",
"department_shortname" : "SYS",
"employment_roles" : [],
"is_employed" : false,
"birthdate" : "01.04.2001",
"location" : "Bern"
"shortname" : "AMA",
"firstname" : "Alice",
"lastname" : "Mante",
"full_name" : "Alice Mante",
"email" : "alice@example.com",
"marital_status" : "single",
"nationalities" : ["AU"],
"graduation" : "MSc in writing",
"department_shortname" : "SYS",
"employment_roles" : [],
"is_employed" : false,
"birthdate" : "01.04.2001",
"location" : "Bern"
}
},
{
"id" : 45,
"type" : "employee",
"attributes" : {
"shortname" : "CFO",
"firstname" : "Charlie",
"lastname" : "Ford",
"email" : "charlie@example.com",
"marital_status" : "married",
"nationalities" : ["GB"],
"graduation" : "MSc in networking",
"department_shortname" : "SYS",
"employment_roles" : []
"shortname" : "CFO",
"firstname" : "Charlie",
"lastname" : "Ford",
"full_name": "Charlie Ford",
"email" : "charlie@example.com",
"marital_status" : "married",
"nationalities" : ["GB"],
"graduation" : "MSc in networking",
"department_shortname" : "SYS",
"employment_roles" : [],
"is_employed" : true,
"birthdate" : "01.10.1980",
"location" : "Thun"
}
}
]
Expand Down
8 changes: 6 additions & 2 deletions spec/fixtures/files/json/new_ptime_employee.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
"shortname": "PFI",
"firstname": "Peterson",
"lastname": "Findus",
"full_name": "Peterson Findus",
"email": "peterson@example.com",
"marital_status": "single",
"nationalities": [
"ZW"
],
"graduation": "Cat caretaker",
"department_shortname": "CAT",
"employment_roles": []
"employment_roles": [],
"is_employed" : true,
"birthdate" : "12.12.1958",
"location" : "Bern"
}
}
]
}
}

0 comments on commit 9c7eef9

Please sign in to comment.