spec/datacite_utils_spec.rb in bolognese-0.7.2 vs spec/datacite_utils_spec.rb in bolognese-0.8

- old
+ new

@@ -15,11 +15,11 @@ context "insert_creators" do it "insert" do xml = Nokogiri::XML::Builder.new { |xml| subject.insert_creators(xml) }.to_xml response = Maremma.from_xml(xml) - expect(response.dig("creators", "creator").first).to eq("creatorName"=>"Ollomo, Benjamin", "givenName"=>"Benjamin", "familyName"=>"Ollomo") + expect(response.dig("creators", "creator").first).to eq("creatorName"=>"Benjamin Ollomo", "givenName"=>"Benjamin", "familyName"=>"Ollomo") end end context "insert_contributors" do it "none" do @@ -81,11 +81,11 @@ context "insert_alternate_identifiers" do it "insert" do xml = Nokogiri::XML::Builder.new { |xml| subject.insert_alternate_identifiers(xml) }.to_xml response = Maremma.from_xml(xml) - expect(response.dig("alternateIdentifiers", "alternateIdentifier")).to eq("alternateIdentifierType"=>"Local accession number", "__content__"=>"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.") + expect(response.dig("alternateIdentifiers", "alternateIdentifier")).to eq("alternateIdentifierType"=>"citation", "__content__"=>"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.") end end context "insert_dates" do it "insert" do @@ -110,20 +110,15 @@ expect(response.fetch("version", nil)).to eq("1") end end context "insert_related_identifiers" do - it "rel_identifiers" do - expect(subject.rel_identifiers).to eq([{"__content__"=>"https://doi.org/10.5061/dryad.8515/1", - "related_identifier_type"=>"DOI", - "relation_type"=>"HasPart"}, - {"__content__"=>"https://doi.org/10.5061/dryad.8515/2", - "related_identifier_type"=>"DOI", - "relation_type"=>"HasPart"}, - {"__content__"=>"https://doi.org/10.1371/journal.ppat.1000446", - "related_identifier_type"=>"DOI", - "relation_type"=>"References"}]) + it "related_identifier" do + expect(subject.related_identifier).to eq([{"id"=>"https://doi.org/10.5061/dryad.8515/1", "relationType"=>"HasPart"}, + {"id"=>"https://doi.org/10.5061/dryad.8515/2", "relationType"=>"HasPart"}, + {"id"=>"https://doi.org/10.1371/journal.ppat.1000446", + "relationType"=>"IsReferencedBy"}]) end it "insert" do xml = Nokogiri::XML::Builder.new { |xml| subject.insert_related_identifiers(xml) }.to_xml response = Maremma.from_xml(xml) @@ -132,19 +127,19 @@ "__content__"=>"https://doi.org/10.5061/dryad.8515/1"}, {"relatedIdentifierType"=>"DOI", "relationType"=>"HasPart", "__content__"=>"https://doi.org/10.5061/dryad.8515/2"}, {"relatedIdentifierType"=>"DOI", - "relationType"=>"References", + "relationType"=>"IsReferencedBy", "__content__"=>"https://doi.org/10.1371/journal.ppat.1000446"}]) end end context "insert_rights_list" do it "insert" do xml = Nokogiri::XML::Builder.new { |xml| subject.insert_rights_list(xml) }.to_xml response = Maremma.from_xml(xml) - expect(response.dig("rightsList", "rights")).to eq("rightsURI"=>"http://creativecommons.org/publicdomain/zero/1.0/", "__content__"=>"Public Domain (CC0 1.0)") + expect(response.dig("rightsList", "rights")).to eq("rightsURI"=>"http://creativecommons.org/publicdomain/zero/1.0/") end end context "insert_descriptions" do it "insert" do