Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

allow sandbox URIs in test data to be returned #1063

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/services/orcid_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def orcidid(contributor)
return identifier.uri if identifier.uri
return identifier.value if identifier.value.start_with?('https://orcid.org/')

URI.join('https://orcid.org/', identifier.value).to_s
# some records have just the ORCIDID without the URL prefix, add it if so, e.g. druid:tp865ng1792
return URI.join('https://orcid.org/', identifier.value).to_s if identifier.source.uri.blank?

URI.join(identifier.source.uri, identifier.value).to_s
end
end
4 changes: 2 additions & 2 deletions spec/indexers/descriptive_metadata_indexer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
type: 'person',
identifier: [
{
uri: 'https://orcid.org/1111-2222-3333-4444',
uri: 'https://sandbox.orcid.org/1111-2222-3333-4444',
type: 'ORCID',
source: {
code: 'orcid'
Expand Down Expand Up @@ -404,7 +404,7 @@
'originInfo_place_placeTerm_tesim' => 'Garden City, N. Y',
'topic_ssim' => %w[Economics cats],
'topic_tesim' => %w[cats Economics],
'contributor_orcids_ssim' => ['https://orcid.org/0000-1111-2222-3333', 'https://orcid.org/1111-2222-3333-4444', 'https://orcid.org/0000-0001-5321-289X']
'contributor_orcids_ssim' => ['https://orcid.org/0000-1111-2222-3333', 'https://sandbox.orcid.org/1111-2222-3333-4444', 'https://orcid.org/0000-0001-5321-289X']
)
end
# rubocop:enable Style/StringHashKeys
Expand Down