spec/readers/crossref_reader_spec.rb in bolognese-1.2.17 vs spec/readers/crossref_reader_spec.rb in bolognese-1.2.18
- old
+ new
@@ -65,9 +65,49 @@
expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.1056/nejm199109123251104", "relatedIdentifierType"=>"DOI", "relationType"=>"References")
expect(subject.container).to eq("firstPage"=>"e30", "identifier"=>"1932-6203", "identifierType"=>"ISSN", "issue"=>"1", "title"=>"PLoS ONE", "type"=>"Journal", "volume"=>"1")
expect(subject.agency).to eq("Crossref")
end
+ it "journal article with funding" do
+ input = "https://doi.org/10.3389/fpls.2019.00816"
+ subject = Bolognese::Metadata.new(input: input)
+ expect(subject.valid?).to be true
+ expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.3389/fpls.2019.00816", "identifierType"=>"DOI"}, {"identifier"=>"816", "identifierType"=>"Publisher ID"}])
+ expect(subject.url).to eq("https://www.frontiersin.org/article/10.3389/fpls.2019.00816/full")
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
+ expect(subject.creators.length).to eq(4)
+ expect(subject.creators.first).to eq("familyName"=>"Fortes", "givenName"=>"Ana Margarida", "name"=>"Fortes, Ana Margarida", "nameType"=>"Personal")
+ expect(subject.titles).to eq([{"title"=>"Transcriptional Modulation of Polyamine Metabolism in Fruit Species Under Abiotic and Biotic Stress"}])
+ expect(subject.rights_list).to eq([{"rightsUri"=>"https://creativecommons.org/licenses/by/4.0"}])
+ expect(subject.dates).to eq([{"date"=>"2019-07-02", "dateType"=>"Issued"}, {"date"=>"2019-07-02T11:08:31Z", "dateType"=>"Updated"}])
+ expect(subject.publication_year).to eq("2019")
+ expect(subject.publisher).to eq("Frontiers Media SA")
+ expect(subject.funding_references).to eq([{"awardNumber"=>"CA17111", "funderIdentifier"=>"https://doi.org/10.13039/501100000921", "funderIdentifierType"=>"Crossref Funder ID", "funderName"=>"COST"}])
+ expect(subject.related_identifiers.length).to eq(70)
+ expect(subject.related_identifiers.first).to eq("relatedIdentifier"=>"1664-462X", "relatedIdentifierType"=>"ISSN", "relationType"=>"IsPartOf", "resourceTypeGeneral"=>"Collection")
+ expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.17660/actahortic.2004.632.41", "relatedIdentifierType"=>"DOI", "relationType"=>"References")
+ expect(subject.container).to eq("identifier"=>"1664-462X", "identifierType"=>"ISSN", "title"=>"Frontiers in Plant Science", "type"=>"Journal", "volume"=>"10")
+ expect(subject.agency).to eq("Crossref")
+ end
+
+ it "journal article original language title" do
+ input = "https://doi.org/10.7600/jspfsm.56.60"
+ subject = Bolognese::Metadata.new(input: input)
+ expect(subject.valid?).to be true
+ expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.7600/jspfsm.56.60", "identifierType"=>"DOI"}])
+ expect(subject.url).to eq("http://jlc.jst.go.jp/JST.JSTAGE/jspfsm/56.60?lang=en&from=CrossRef&type=abstract")
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
+ expect(subject.creators).to eq("name"=>":(unav)", "nameType"=>"Organizational")
+ expect(subject.titles).to eq([{"lang"=>"ja", "title"=>"自律神経・循環器応答"}])
+ expect(subject.dates).to eq([{"date"=>"2007", "dateType"=>"Issued"}, {"date"=>"2019-07-03T06:23:13Z", "dateType"=>"Updated"}])
+ expect(subject.publication_year).to eq("2007")
+ expect(subject.publisher).to eq("The Japanese Society of Physical Fitness and Sports Medicine")
+ expect(subject.related_identifiers.length).to eq(1)
+ expect(subject.related_identifiers.first).to eq("relatedIdentifier"=>"0039-906X", "relatedIdentifierType"=>"ISSN", "relationType"=>"IsPartOf", "resourceTypeGeneral"=>"Collection")
+ expect(subject.container).to eq("firstPage"=>"60", "identifier"=>"0039-906X", "identifierType"=>"ISSN", "issue"=>"1", "lastPage"=>"60", "title"=>"Japanese Journal of Physical Fitness and Sports Medicine", "type"=>"Journal", "volume"=>"56")
+ expect(subject.agency).to eq("Crossref")
+ end
+
it "posted_content" do
input = "https://doi.org/10.1101/097196"
subject = Bolognese::Metadata.new(input: input)
expect(subject.valid?).to be true
expect(subject.url).to eq("http://biorxiv.org/lookup/doi/10.1101/097196")