diff --git a/app/models/air_table_staff/staff_directory_mapping.rb b/app/models/air_table_staff/staff_directory_mapping.rb index a1dd6e05..d2cc0851 100644 --- a/app/models/air_table_staff/staff_directory_mapping.rb +++ b/app/models/air_table_staff/staff_directory_mapping.rb @@ -28,8 +28,9 @@ def fields { airtable_field: :'Area of Study', our_field: :areasOfStudy, transformer: ->(areas) { areas&.join('//') } }, { airtable_field: :'Website URL', our_field: :websiteUrl }, { airtable_field: :Bios, our_field: :bios }, - { airtable_field: :Expertise, our_field: :expertise, transformer: ->(areas) { areas&.join('//') } }, - { airtable_field: :'My Scheduler Link', our_field: :mySchedulerLink } + { airtable_field: :Expertise, our_field: :expertise, transformer: ->(expertises) { expertises&.join('//') } }, + { airtable_field: :'My Scheduler Link', our_field: :mySchedulerLink }, + { airtable_field: :'Other Entities', our_field: :otherEntities, transformer: ->(entities) { entities&.join('//') } } ] end # rubocop:enable Metrics/MethodLength diff --git a/spec/fixtures/files/air_table/records_no_offset.json b/spec/fixtures/files/air_table/records_no_offset.json index 3f92145b..9d3892a6 100644 --- a/spec/fixtures/files/air_table/records_no_offset.json +++ b/spec/fixtures/files/air_table/records_no_offset.json @@ -17,7 +17,8 @@ "pul:Preferred Name": "Phillip Librarian", "Email": "ab123@princeton.edu", "Bios": "Hello\nMy research interests\nare\n\nfantastic!", - "My Scheduler Link": "https://example.com" + "My Scheduler Link": "https://example.com", + "Other Entities": ["Industrial Relations", "James Madison Program"] } } ] diff --git a/spec/models/air_table_staff/csv_builder_spec.rb b/spec/models/air_table_staff/csv_builder_spec.rb index 2a0a75bf..4bb69519 100644 --- a/spec/models/air_table_staff/csv_builder_spec.rb +++ b/spec/models/air_table_staff/csv_builder_spec.rb @@ -16,12 +16,12 @@ # Since the cell is in in double quotes, it will still be read # as a single cell within a single row" expected = <<~END_CSV - puid,netid,phone,name,lastName,firstName,email,address,building,department,division,unit,team,title,areasOfStudy,websiteUrl,bios,expertise,mySchedulerLink + puid,netid,phone,name,lastName,firstName,email,address,building,department,division,unit,team,title,areasOfStudy,websiteUrl,bios,expertise,mySchedulerLink,otherEntities 123,ab123,(123) 123-1234,Phillip Librarian,Librarian,Phillip,ab123@princeton.edu,123 Stokes,Stokes,Stokes,,,,Library Collections Specialist V,Virtual Reality,,"Hello My research interests are - fantastic!",,https://example.com + fantastic!",,https://example.com,Industrial Relations//James Madison Program END_CSV directory = described_class.new expect(directory.to_csv).to eq(expected) diff --git a/spec/models/air_table_staff/staff_directory_person_spec.rb b/spec/models/air_table_staff/staff_directory_person_spec.rb index 6fffaf6a..ef890a26 100644 --- a/spec/models/air_table_staff/staff_directory_person_spec.rb +++ b/spec/models/air_table_staff/staff_directory_person_spec.rb @@ -24,7 +24,8 @@ "\n\nKevin heads the Discovery and Access Services Team that supports the Library Catalog. \n", 'Website URL': 'https://github.com/kevinreiss', 'Area of Study': ['Chemistry', 'African American Studies'], - 'My Scheduler Link': 'https://example.com' + 'My Scheduler Link': 'https://example.com', + 'Other Entities': ['Industrial Relations', 'James Madison Program'] } expected = [ '987654321', # puid @@ -49,7 +50,8 @@ "\n\nKevin heads the Discovery and Access Services Team "\ "that supports the Library Catalog. \n", # bios 'Discovery//Library Systems', # expertise - 'https://example.com' # mySchedulerLink + 'https://example.com', # mySchedulerLink + 'Industrial Relations//James Madison Program' # otherEntities ] expect(described_class.new(json).to_a).to eq(expected) diff --git a/spec/models/air_table_staff/staff_list_job_spec.rb b/spec/models/air_table_staff/staff_list_job_spec.rb index d5d47c58..9d474726 100644 --- a/spec/models/air_table_staff/staff_list_job_spec.rb +++ b/spec/models/air_table_staff/staff_list_job_spec.rb @@ -23,7 +23,7 @@ [ '123', 'ab123', '(123) 123-1234', 'Phillip Librarian', 'Librarian', 'Phillip', 'ab123@princeton.edu', '123 Stokes', 'Stokes', 'Stokes', nil, nil, nil, 'Library Collections Specialist V', 'Virtual Reality', - nil, "Hello\nMy research interests\nare\n\nfantastic!", nil, 'https://example.com' + nil, "Hello\nMy research interests\nare\n\nfantastic!", nil, 'https://example.com', 'Industrial Relations//James Madison Program' ] end