Skip to content

Commit

Permalink
update test expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcam-src committed Aug 16, 2024
1 parent 1cedde3 commit e9443dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion spec/fixtures/files/dimensions_ingest_test_fixture.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@
"current_organization_id": "grid.10698.36",
"first_name": "Susan L",
"last_name": "Hogan",
"orcid": null,
"orcid": [
"0000-0000-0000-0000"
],
"raw_affiliation": [
"UNC Kidney Center, Division of Nephrology and Hypertension, University of North Carolina, Chapel Hill."
],
Expand Down
9 changes: 4 additions & 5 deletions spec/services/tasks/dimensions_ingest_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,14 @@
author['affiliations'].any? { |affiliation| affiliation['id'] == unc_grid_id }
end
first_unc_affiliation = unc_affiliated_author['affiliations'].find { |affiliation| affiliation['id'] == unc_grid_id }
# Ensure the author's first affiliation is not the UNC affiliation
unc_affiliated_author['affiliations'].unshift(non_unc_affiliation)
# Spoof author orcid if it's missing
unc_affiliated_author['orcid'] ||= ['0000-0000-0000-0000']
author_hash = service.author_to_hash(unc_affiliated_author, 0)
expect(author_hash).to eq(
{
'name' => "#{[unc_affiliated_author['last_name'], unc_affiliated_author['first_name']].compact.join(', ')}",
'other_affiliation' => first_unc_affiliation['raw_affiliation'],
'orcid' => "https://orcid.org/#{unc_affiliated_author['orcid'][0]}",
'name' => 'Hogan, Susan L',
'other_affiliation' => 'UNC Kidney Center, Division of Nephrology and Hypertension, University of North Carolina, Chapel Hill.',
'orcid' => 'https://orcid.org/0000-0000-0000-0000',
'index' => '1'
}
)
Expand Down

0 comments on commit e9443dc

Please sign in to comment.