spec/crossref_spec.rb in bolognese-0.5.2 vs spec/crossref_spec.rb in bolognese-0.5.3
- old
+ new
@@ -22,10 +22,20 @@
expect(subject.date_published).to eq("2014-02-11")
expect(subject.date_modified).to eq("2015-08-11T05:35:02Z")
expect(subject.is_part_of).to eq("@type"=>"Periodical", "name"=>"eLife", "issn"=>"2050-084X")
expect(subject.citation.count).to eq(27)
expect(subject.citation[21]).to eq("@type"=>"CreativeWork", "@id"=>"https://doi.org/10.5061/dryad.b835k", "position"=>"22", "datePublished"=>"2014")
+ expect(subject.funder).to eq([{"@type"=>"Organization", "name"=>"SystemsX"},
+ {"@type"=>"Organization",
+ "@id"=>"https://doi.org/10.13039/501100003043",
+ "name"=>"EMBO"},
+ {"@type"=>"Organization",
+ "@id"=>"https://doi.org/10.13039/501100001711",
+ "name"=>"Swiss National Science Foundation"},
+ {"@type"=>"Organization",
+ "@id"=>"https://doi.org/10.13039/501100006390",
+ "name"=>"University of Lausanne"}])
expect(subject.provider).to eq("@type"=>"Organization", "name"=>"Crossref")
end
it "journal article" do
id = "https://doi.org/10.1371/journal.pone.0000030"
@@ -186,9 +196,11 @@
expect(subject.validation_errors).to be_empty
datacite = Maremma.from_xml(subject.as_datacite).fetch("resource", {})
expect(datacite.dig("resourceType", "resourceTypeGeneral")).to eq("Text")
expect(datacite.dig("titles", "title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
expect(datacite.dig("relatedIdentifiers", "relatedIdentifier").count).to eq(25)
+ expect(datacite.dig("fundingReferences", "fundingReference").count).to eq(4)
+ expect(datacite.dig("fundingReferences", "fundingReference").last).to eq("funderName"=>"University of Lausanne", "funderIdentifier"=>{"funderIdentifierType"=>"Crossref Funder ID", "__content__"=>"https://doi.org/10.13039/501100006390"})
end
it "with ORCID ID" do
id = "https://doi.org/10.1155/2012/291294"
subject = Bolognese::Crossref.new(id: id)