From 39f510021fdf99b963d3fa944f77eb51ed0be4c2 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sun, 3 May 2020 23:42:27 +0200 Subject: [PATCH 1/2] proper support for alternate identifiers --- Gemfile.lock | 14 +-- app/controllers/dois_controller.rb | 15 ++- app/serializers/doi_serializer.rb | 8 +- spec/requests/dois_spec.rb | 151 ++++++++++++++++++++++++++++- 4 files changed, 177 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f3b59f173..00a1f62ec 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,7 +60,7 @@ GEM audited (4.9.0) activerecord (>= 4.2, < 6.1) aws-eventstream (1.1.0) - aws-partitions (1.305.0) + aws-partitions (1.308.0) aws-sdk-core (3.94.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) @@ -102,7 +102,7 @@ GEM latex-decode (~> 0.0) binding_of_caller (0.8.0) debug_inspector (>= 0.0.1) - bolognese (1.5.17) + bolognese (1.5.21) activesupport (>= 4.2.5) benchmark_methods (~> 0.7) bibtex-ruby (>= 5.1.0) @@ -355,7 +355,7 @@ GEM optimist (3.0.1) pandoc-ruby (2.1.4) parallel (1.19.1) - parser (2.7.1.1) + parser (2.7.1.2) ast (~> 2.4.0) postrank-uri (1.0.24) addressable (>= 2.4.0) @@ -405,7 +405,7 @@ GEM thor (>= 0.19.0, < 2.0) rainbow (3.0.0) rake (12.3.3) - rb-fsevent (0.10.3) + rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) rchardet (1.8.0) @@ -445,8 +445,8 @@ GEM benchmark-perf (~> 0.4.0) benchmark-trend (~> 0.2.0) rspec (>= 3.0.0, < 4.0.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) + rspec-core (3.9.2) + rspec-support (~> 3.9.3) rspec-expectations (3.9.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) @@ -463,7 +463,7 @@ GEM rspec-expectations (~> 3.9.0) rspec-mocks (~> 3.9.0) rspec-support (~> 3.9.0) - rspec-support (3.9.2) + rspec-support (3.9.3) rubocop (0.77.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) diff --git a/app/controllers/dois_controller.rb b/app/controllers/dois_controller.rb index 3b35014e1..11c718884 100644 --- a/app/controllers/dois_controller.rb +++ b/app/controllers/dois_controller.rb @@ -606,6 +606,8 @@ def safe_params { contributors: [:nameType, { nameIdentifiers: [:nameIdentifier, :nameIdentifierScheme, :schemeUri] }, :name, :givenName, :familyName, { affiliation: [:name, :affiliationIdentifier, :affiliationIdentifierScheme, :schemeUri] }, :contributorType, :lang] }, :identifiers, { identifiers: [:identifier, :identifierType] }, + :alternateIdentifiers, + { alternateIdentifiers: [:alternateIdentifier, :alternateIdentifierType] }, :relatedIdentifiers, { relatedIdentifiers: [:relatedIdentifier, :relatedIdentifierType, :relationType, :relatedMetadataScheme, :schemeUri, :schemeType, :resourceTypeGeneral, :relatedMetadataScheme, :schemeUri, :schemeType] }, :fundingReferences, @@ -680,7 +682,7 @@ def safe_params read_attrs_keys = [:url, :creators, :contributors, :titles, :publisher, :publicationYear, :types, :descriptions, :container, :sizes, - :formats, :language, :dates, :identifiers, :relatedIdentifiers, + :formats, :language, :dates, :identifiers, :alternateIdentifiers, :relatedIdentifiers, :fundingReferences, :geoLocations, :rightsList, :agency, :subjects, :contentUrl, :schemaVersion] @@ -689,14 +691,23 @@ def safe_params read_attrs_keys.each do |attr| p.merge!(attr.to_s.underscore => p[attr] || meta[attr.to_s.underscore] || p[attr]) if p.has_key?(attr) || meta.has_key?(attr.to_s.underscore) end + + # handle alternate_identifiers + p[:identifiers] = Array.wrap(p[:alternate_identifiers]).map do |a| + { "identifierType" => a["alternateIdentifierType"], "identifier" => a["alternateIdentifier"] } + end.compact + + # handle version metadata p[:version_info] = p[:version] || meta["version_info"] if p.has_key?(:version) || meta["version_info"].present? + # only update landing_page info if something is received via API to not overwrite existing data p.merge!(landing_page: p[:landingPage]) if p[:landingPage].present? p.merge( regenerate: p[:regenerate] || regenerate ).except( - :confirmDoi, :prefix, :suffix, :publicationYear, + # ignore camelCase keys, read-only keys and alternate_identifiers + :confirmDoi, :prefix, :suffix, :publicationYear, :alternateIdentifiers, :alternate_identifiers, :rightsList, :relatedIdentifiers, :fundingReferences, :geoLocations, :metadataVersion, :schemaVersion, :state, :mode, :isActive, :landingPage, :created, :registered, :updated, :published, :lastLandingPage, :version, diff --git a/app/serializers/doi_serializer.rb b/app/serializers/doi_serializer.rb index 514d1ad9e..f4931b017 100644 --- a/app/serializers/doi_serializer.rb +++ b/app/serializers/doi_serializer.rb @@ -6,7 +6,7 @@ class DoiSerializer set_id :uid # don't cache dois, as works are cached using the doi model - attributes :doi, :prefix, :suffix, :identifiers, :creators, :titles, :publisher, :container, :publication_year, :subjects, :contributors, :dates, :language, :types, :related_identifiers, :sizes, :formats, :version, :rights_list, :descriptions, :geo_locations, :funding_references, :xml, :url, :content_url, :metadata_version, :schema_version, :source, :is_active, :state, :reason, :landing_page, :view_count, :views_over_time, :download_count, :downloads_over_time, :reference_count, :citation_count, :citations_over_time, :part_count, :part_of_count, :version_count, :version_of_count, :created, :registered, :published, :updated + attributes :doi, :prefix, :suffix, :identifiers, :alternate_identifiers, :creators, :titles, :publisher, :container, :publication_year, :subjects, :contributors, :dates, :language, :types, :related_identifiers, :sizes, :formats, :version, :rights_list, :descriptions, :geo_locations, :funding_references, :xml, :url, :content_url, :metadata_version, :schema_version, :source, :is_active, :state, :reason, :landing_page, :view_count, :views_over_time, :download_count, :downloads_over_time, :reference_count, :citation_count, :citations_over_time, :part_count, :part_of_count, :version_count, :version_of_count, :created, :registered, :published, :updated attributes :prefix, :suffix, :views_over_time, :downloads_over_time, :citations_over_time, if: Proc.new { |object, params| params && params[:detail] } belongs_to :client, record_type: :clients @@ -72,6 +72,12 @@ class DoiSerializer Array.wrap(object.identifiers) end + attribute :alternate_identifiers, if: Proc.new { |object, params| params && params[:detail] } do |object| + Array.wrap(object.identifiers).select { |r| r["identifierType"] != "DOI" }.map do |a| + { "alternateIdentifierType" => a["identifierType"], "alternateIdentifier" => a["identifier"] } + end.compact + end + attribute :related_identifiers, if: Proc.new { |object, params| params && params[:composite].blank? } do |object| Array.wrap(object.related_identifiers) end diff --git a/spec/requests/dois_spec.rb b/spec/requests/dois_spec.rb index c1d8da63d..771c0570d 100644 --- a/spec/requests/dois_spec.rb +++ b/spec/requests/dois_spec.rb @@ -186,6 +186,8 @@ expect(result.dig('attributes', 'doi')).to eq(doi.doi.downcase) expect(result.dig('attributes', 'titles')).to eq(doi.titles) + expect(result.dig('attributes', 'identifiers')).to eq([{"identifier"=>"Ollomo B, Durand P, Prugnolle F, Douzery EJP, Arnathau C, Nkoghe D, Leroy E, Renaud F (2009) A new malaria agent in African hominids. PLoS Pathogens 5(5): e1000446.", "identifierType"=>"citation"}]) + expect(result.dig('attributes', 'alternateIdentifiers')).to eq([{"identifier"=>"Ollomo B, Durand P, Prugnolle F, Douzery EJP, Arnathau C, Nkoghe D, Leroy E, Renaud F (2009) A new malaria agent in African hominids. PLoS Pathogens 5(5): e1000446.", "identifierType"=>"citation"}]) # expect(result.dig('relationships','citations', 'data')).to be_empty end end @@ -203,7 +205,6 @@ let(:provider_bearer) { Client.generate_token(role_id: "provider_admin", uid: provider.symbol, provider_id: provider.symbol.downcase, password: provider.password) } let(:provider_headers) { { 'HTTP_ACCEPT'=>'application/vnd.api+json', 'HTTP_AUTHORIZATION' => 'Bearer ' + provider_bearer }} - it 'returns the Doi' do get "/dois/#{doi.doi}", nil, provider_headers @@ -1571,6 +1572,154 @@ end end + context 'when the request is valid with recommended properties' do + let(:valid_attributes) do + { + "data" => { + "type" => "dois", + "attributes" => { + "doi" => "10.14454/10703", + "url" => "http://www.bl.uk/pdf/patspec.pdf", + "types" => { "bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"BlogPosting", "resourceTypeGeneral"=>"Text", "ris"=>"RPRT", "schemaOrg"=>"ScholarlyArticle" }, + "titles" => [{"title"=>"Eating your own Dog Food"}], + "publisher" => "DataCite", + "publicationYear" => 2016, + "creators" => [{"familyName"=>"Fenner", "givenName"=>"Martin", "nameIdentifiers"=>[{ "nameIdentifier" => "https://orcid.org/0000-0003-1419-2405", "nameIdentifierScheme" => "ORCID", "schemeUri"=>"https://orcid.org" }], "name"=>"Fenner, Martin", "nameType"=>"Personal"}], + "subjects" => [{ "subject" => "80505 Web Technologies (excl. Web Search)", + "schemeUri" => "http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E", + "subjectScheme" => "FOR", + "lang" => "en" }], + "contributors" => [{"contributorType"=>"DataManager", "familyName"=>"Fenner", "givenName"=>"Kurt", "nameIdentifiers"=>[{ "nameIdentifier" => "https://orcid.org/0000-0003-1419-2401", "nameIdentifierScheme" => "ORCID", "schemeUri"=>"https://orcid.org" }], "name"=>"Fenner, Kurt", "nameType"=>"Personal"}], + "dates" => [{"date"=>"2017-02-24", "dateType"=>"Issued"}, {"date"=>"2015-11-28", "dateType"=>"Created"}, {"date"=>"2017-02-24", "dateType"=>"Updated"}], + "relatedIdentifiers" => [{ "relatedIdentifier"=>"10.5438/55e5-t5c0", "relatedIdentifierType"=>"DOI", "relationType"=>"References" }], + "descriptions" => [ + { + "lang" => "en", + "description" => "Diet and physical activity are two modifiable factors that can curtail the development of osteoporosis in the aging population. One purpose of this study was to assess the differences in dietary intake and bone mineral density (BMD) in a Masters athlete population (n=87, n=49 female; 41.06 ± 5.00 years of age) and examine sex- and sport-related differences in dietary and total calcium and vitamin K intake and BMD of the total body, lumbar spine, and dual femoral neck (TBBMD, LSBMD and DFBMD, respectively). Total calcium is defined as calcium intake from diet and supplements. Athletes were categorized as participating in an endurance or interval sport. BMD was measured using dual-energy X-ray absorptiometry (DXA). Data on dietary intake was collected from Block 2005 Food Frequency Questionnaires (FFQs). Dietary calcium, total calcium, or vitamin K intake did not differ between the female endurance and interval athletes. All three BMD sites were significantly different among the female endurance and interval athletes, with female interval athletes having higher BMD at each site (TBBMD: 1.26 ± 0.10 g/cm2, p<0.05; LSBMD: 1.37 ± 0.14 g/cm2, p<0.01; DFBMD: 1.11 ± 0.12 g/cm2, p<0.05, for female interval athletes; TBBMD: 1.19 ± 0.09 g/cm2; LSBMD: 1.23 ± 0.16 g/cm2; DFBMD: 1.04 ± 0.10 g/cm2, for female endurance athletes). Male interval athletes had higher BMD at all three sites (TBBMD 1.44 ± 0.11 g/cm2, p<0.05; LSBMD 1.42 ± 0.15 g/cm2, p=0.179; DFBMD 1.26 ± 0.14 g/cm2, p<0.01, for male interval athletes; TBBMD 1.33 ± 0.11 g/cm2; LSBMD 1.33 ± 0.17 g/cm2; DFBMD 1.10 ± 0.12 g/cm2 for male endurance athletes). Dietary calcium, total daily calcium and vitamin K intake did not differ between the male endurance and interval athletes. This study evaluated the relationship between calcium intake and BMD. No relationship between dietary or total calcium intake and BMD was evident in all female athletes, female endurance athletes or female interval athletes. In all male athletes, there was no significant correlation between dietary or total calcium intake and BMD at any of the measured sites. However, the male interval athlete group had a negative relationship between dietary calcium intake and TBBMD (r=-0.738, p<0.05) and LSBMD (r=-0.738, p<0.05). The negative relationship persisted between total calcium intake and LSBMD (r=-0.714, p<0.05), but not TBBMD, when calcium from supplements was included. The third purpose of this study was to evaluate the relationship between vitamin K intake (as phylloquinone) and BMD. In all female athletes, there was no significant correlation between vitamin K intake and BMD at any of the measured sites. No relationship between vitamin K and BMD was evident in female interval or female endurance athletes. Similarly, there was no relationship between vitamin K intake and BMD in the male endurance and interval groups. The final purpose of this study was to assess the relationship between the Calcium-to-Vitamin K (Ca:K) ratio and BMD. A linear regression model established that the ratio predicted TBBMD in female athletes, F(1,47) = 4.652, p <0.05, and the ratio accounted for 9% of the variability in TBBMD. The regression equation was: predicted TBBMD in a female athlete = 1.250 - 0.008 x (Ca:K). In conclusion, Masters interval athletes have higher BMD than Masters endurance athletes; however, neither dietary or supplemental calcium nor vitamin K were related to BMD in skeletal sites prone to fracture in older adulthood. We found that a Ca:K ratio could predict TBBMD in female athletes. Further research should consider the calcium-to-vitamin K relationship in conjunction with other modifiable, lifestyle factors associated with bone health in the investigation of methods to minimize the development and effect of osteoporosis in the older athlete population.", + "descriptionType" => "Abstract" + } + ], + "geoLocations" => [ + { + "geoLocationPoint" => { + "pointLatitude" => "49.0850736", + "pointLongitude" => "-123.3300992" + } + } + ], + "source" => "test", + "event" => "publish" + } + } + } + end + + it 'creates a Doi' do + post '/dois', valid_attributes, headers + + expect(last_response.status).to eq(201) + expect(json.dig('data', 'attributes', 'url')).to eq("http://www.bl.uk/pdf/patspec.pdf") + expect(json.dig('data', 'attributes', 'doi')).to eq("10.14454/10703") + expect(json.dig('data', 'attributes', 'titles')).to eq([{"title"=>"Eating your own Dog Food"}]) + expect(json.dig('data', 'attributes', 'creators')).to eq([{"affiliation"=>[],"familyName"=>"Fenner", "givenName"=>"Martin", "nameIdentifiers"=>[{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2405","nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Fenner, Martin", "nameType"=>"Personal"}]) + expect(json.dig('data', 'attributes', 'publisher')).to eq("DataCite") + expect(json.dig('data', 'attributes', 'publicationYear')).to eq(2016) + # expect(json.dig('data', 'attributes', 'schemaVersion')).to eq("http://datacite.org/schema/kernel-4") + expect(json.dig('data', 'attributes', 'subjects')).to eq([{"lang"=>"en", + "schemeUri"=> + "http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E", + "subject"=>"80505 Web Technologies (excl. Web Search)", + "subjectScheme"=>"FOR"}]) + expect(json.dig('data', 'attributes', 'contributors')).to eq([{"affiliation"=>[], + "contributorType"=>"DataManager", + "familyName"=>"Fenner", + "givenName"=>"Kurt", + "name"=>"Fenner, Kurt", + "nameIdentifiers"=> + [{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2401", + "nameIdentifierScheme"=>"ORCID", + "schemeUri"=>"https://orcid.org"}], + "nameType"=>"Personal"}]) + expect(json.dig('data', 'attributes', 'dates')).to eq([{"date"=>"2017-02-24", "dateType"=>"Issued"}, {"date"=>"2015-11-28", "dateType"=>"Created"}, {"date"=>"2017-02-24", "dateType"=>"Updated"}]) + expect(json.dig('data', 'attributes', 'relatedIdentifiers')).to eq([{"relatedIdentifier"=>"10.5438/55e5-t5c0", "relatedIdentifierType"=>"DOI", "relationType"=>"References"}]) + expect(json.dig('data', 'attributes', 'descriptions', 0, 'description')).to start_with("Diet and physical activity") + expect(json.dig('data', 'attributes', 'geoLocations')).to eq([{"geoLocationPoint"=>{"pointLatitude"=>"49.0850736", "pointLongitude"=>"-123.3300992"}}]) + expect(json.dig('data', 'attributes', 'source')).to eq("test") + expect(json.dig('data', 'attributes', 'types')).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"BlogPosting", "resourceTypeGeneral"=>"Text", "ris"=>"RPRT", "schemaOrg"=>"ScholarlyArticle") + expect(json.dig('data', 'attributes', 'state')).to eq("findable") + + doc = Nokogiri::XML(Base64.decode64(json.dig('data', 'attributes', 'xml')), nil, 'UTF-8', &:noblanks) + expect(doc.at_css("identifier").content).to eq("10.14454/10703") + expect(doc.at_css("subjects").content).to eq("80505 Web Technologies (excl. Web Search)") + expect(doc.at_css("contributors").content).to eq("Fenner, KurtKurtFennerhttps://orcid.org/0000-0003-1419-2401") + expect(doc.at_css("dates").content).to eq("2017-02-242015-11-282017-02-24") + expect(doc.at_css("relatedIdentifiers").content).to eq("10.5438/55e5-t5c0") + expect(doc.at_css("descriptions").content).to start_with("Diet and physical activity") + expect(doc.at_css("geoLocations").content).to eq("49.0850736-123.3300992") + end + end + + context 'when the request is valid with optional properties' do + let(:valid_attributes) do + { + "data" => { + "type" => "dois", + "attributes" => { + "doi" => "10.14454/10703", + "url" => "http://www.bl.uk/pdf/patspec.pdf", + "types" => { "bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"BlogPosting", "resourceTypeGeneral"=>"Text", "ris"=>"RPRT", "schemaOrg"=>"ScholarlyArticle" }, + "titles" => [{"title"=>"Eating your own Dog Food"}], + "publisher" => "DataCite", + "publicationYear" => 2016, + "creators" => [{"familyName"=>"Fenner", "givenName"=>"Martin", "nameIdentifiers"=>[{ "nameIdentifier" => "https://orcid.org/0000-0003-1419-2405", "nameIdentifierScheme" => "ORCID", "schemeUri"=>"https://orcid.org" }], "name"=>"Fenner, Martin", "nameType"=>"Personal"}], + "language" => "en", + "alternateIdentifiers" => [{ "alternateIdentifier" => "123", "alternateIdentifierType" => "Repository ID" }], + "rightsList" => [{ "rights" => "Creative Commons Attribution 3.0", "rightsUri" => "http://creativecommons.org/licenses/by/3.0/", "lang" => "en"}], + "sizes" => ["4 kB", "12.6 MB"], + "formats" => ["application/pdf", "text/csv"], + "version" => "1.1", + "fundingReferences" => [{"funderIdentifier"=>"https://doi.org/10.13039/501100009053", "funderIdentifierType"=>"Crossref Funder ID", "funderName"=>"The Wellcome Trust DBT India Alliance"}], + "source" => "test", + "event" => "publish" + } + } + } + end + + it 'creates a Doi' do + post '/dois', valid_attributes, headers + + expect(last_response.status).to eq(201) + expect(json.dig('data', 'attributes', 'url')).to eq("http://www.bl.uk/pdf/patspec.pdf") + expect(json.dig('data', 'attributes', 'doi')).to eq("10.14454/10703") + expect(json.dig('data', 'attributes', 'titles')).to eq([{"title"=>"Eating your own Dog Food"}]) + expect(json.dig('data', 'attributes', 'creators')).to eq([{"affiliation"=>[],"familyName"=>"Fenner", "givenName"=>"Martin", "nameIdentifiers"=>[{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2405","nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Fenner, Martin", "nameType"=>"Personal"}]) + expect(json.dig('data', 'attributes', 'publisher')).to eq("DataCite") + expect(json.dig('data', 'attributes', 'publicationYear')).to eq(2016) + # expect(json.dig('data', 'attributes', 'schemaVersion')).to eq("http://datacite.org/schema/kernel-4") + expect(json.dig('data', 'attributes', 'language')).to eq("en") + expect(json.dig('data', 'attributes', 'alternateIdentifiers')).to eq([{"alternateIdentifier"=>"123", "alternateIdentifierType"=>"Repository ID"}]) + expect(json.dig('data', 'attributes', 'rightsList')).to eq([{"lang"=>"en", "rights"=>"Creative Commons Attribution 3.0", "rightsUri"=>"http://creativecommons.org/licenses/by/3.0/"}]) + expect(json.dig('data', 'attributes', 'sizes')).to eq(["4 kB", "12.6 MB"]) + expect(json.dig('data', 'attributes', 'formats')).to eq(["application/pdf", "text/csv"]) + expect(json.dig('data', 'attributes', 'version')).to eq("1.1") + expect(json.dig('data', 'attributes', 'fundingReferences')).to eq([{"funderIdentifier"=>"https://doi.org/10.13039/501100009053", "funderIdentifierType"=>"Crossref Funder ID", "funderName"=>"The Wellcome Trust DBT India Alliance"}]) + expect(json.dig('data', 'attributes', 'source')).to eq("test") + expect(json.dig('data', 'attributes', 'types')).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"BlogPosting", "resourceTypeGeneral"=>"Text", "ris"=>"RPRT", "schemaOrg"=>"ScholarlyArticle") + expect(json.dig('data', 'attributes', 'state')).to eq("findable") + + doc = Nokogiri::XML(Base64.decode64(json.dig('data', 'attributes', 'xml')), nil, 'UTF-8', &:noblanks) + expect(doc.at_css("identifier").content).to eq("10.14454/10703") + expect(doc.at_css("language").content).to eq("en") + expect(doc.at_css("alternateIdentifiers").content).to eq("123") + expect(doc.at_css("rightsList").content).to eq("Creative Commons Attribution 3.0") + expect(doc.at_css("sizes").content).to eq("4 kB12.6 MB") + expect(doc.at_css("formats").content).to eq("application/pdftext/csv") + expect(doc.at_css("version").content).to eq("1.1") + expect(doc.at_css("fundingReferences").content).to eq("The Wellcome Trust DBT India Alliancehttps://doi.org/10.13039/501100009053") + end + end + context 'with affiliation' do let(:xml) { ::Base64.strict_encode64(File.read(file_fixture('datacite-example-affiliation.xml'))) } let(:params) do From 2d06d92b579b424f2d7f9169b6ab4c3ab00bbabb Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 4 May 2020 11:37:33 +0200 Subject: [PATCH 2/2] fix test --- spec/requests/dois_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/requests/dois_spec.rb b/spec/requests/dois_spec.rb index 771c0570d..5ef858818 100644 --- a/spec/requests/dois_spec.rb +++ b/spec/requests/dois_spec.rb @@ -187,7 +187,7 @@ expect(result.dig('attributes', 'doi')).to eq(doi.doi.downcase) expect(result.dig('attributes', 'titles')).to eq(doi.titles) expect(result.dig('attributes', 'identifiers')).to eq([{"identifier"=>"Ollomo B, Durand P, Prugnolle F, Douzery EJP, Arnathau C, Nkoghe D, Leroy E, Renaud F (2009) A new malaria agent in African hominids. PLoS Pathogens 5(5): e1000446.", "identifierType"=>"citation"}]) - expect(result.dig('attributes', 'alternateIdentifiers')).to eq([{"identifier"=>"Ollomo B, Durand P, Prugnolle F, Douzery EJP, Arnathau C, Nkoghe D, Leroy E, Renaud F (2009) A new malaria agent in African hominids. PLoS Pathogens 5(5): e1000446.", "identifierType"=>"citation"}]) + expect(result.dig('attributes', 'alternateIdentifiers')).to eq([{"alternateIdentifier"=>"Ollomo B, Durand P, Prugnolle F, Douzery EJP, Arnathau C, Nkoghe D, Leroy E, Renaud F (2009) A new malaria agent in African hominids. PLoS Pathogens 5(5): e1000446.", "alternateIdentifierType"=>"citation"}]) # expect(result.dig('relationships','citations', 'data')).to be_empty end end