spec/writers/datacite_writer_spec.rb in bolognese-1.8.3 vs spec/writers/datacite_writer_spec.rb in bolognese-1.8.4

- old
+ new

@@ -145,11 +145,11 @@ expect(subject.rights_list).to eq([{"rights"=>"Open Access", "rightsUri"=>"info:eu-repo/semantics/openAccess"}]) expect(subject.dates).to eq([{"date"=>"2015-08-19", "dateType"=>"Issued"}]) expect(subject.publication_year).to eq("2015") expect(subject.version_info).to eq("v0.3.2") expect(subject.publisher).to eq("Zenodo") - expect(subject.agency).to eq("DataCite") + expect(subject.agency).to eq("datacite") expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4") expect(subject.datacite).to include("<version>v0.3.2</version>") end it "Text pass-thru" do @@ -171,11 +171,11 @@ expect(subject.publisher).to eq("Figshare") expect(subject.subjects).to eq([{"subject"=>"Information Systems"}, {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf", "subject"=>"FOS: Computer and information sciences", "subjectScheme"=>"Fields of Science and Technology (FOS)"}]) - expect(subject.agency).to eq("DataCite") + expect(subject.agency).to eq("datacite") expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3") expect(subject.datacite).to end_with("</resource>") end it "Text pass-thru with doi in options" do @@ -197,11 +197,11 @@ expect(subject.publisher).to eq("Figshare") expect(subject.subjects).to eq([{"subject"=>"Information Systems"}, {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf", "subject"=>"FOS: Computer and information sciences", "subjectScheme"=>"Fields of Science and Technology (FOS)"}]) - expect(subject.agency).to eq("DataCite") + expect(subject.agency).to eq("datacite") expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3") expect(subject.datacite).to end_with("</resource>") end it "Dataset in schema 4.0" do @@ -222,11 +222,11 @@ expect(subject.publication_year).to eq("2011") expect(subject.related_identifiers.length).to eq(1) expect(subject.related_identifiers.last).to eq("relatedIdentifier" => "10.1371/journal.ppat.1000446", "relatedIdentifierType" => "DOI","relationType"=>"IsSupplementTo") expect(subject.publisher).to eq("Dryad") - expect(subject.agency).to eq("DataCite") + expect(subject.agency).to eq("datacite") expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4") datacite = Maremma.from_xml(subject.datacite).fetch("resource", {}) expect(datacite.fetch("xsi:schemaLocation", "").split(" ").first).to eq("http://datacite.org/schema/kernel-4") end @@ -247,11 +247,11 @@ "rightsUri"=>"https://creativecommons.org/licenses/by/4.0/legalcode", "schemeUri"=>"https://spdx.org/licenses/"}]) expect(subject.dates).to eq([{"date"=>"2014-10-17", "dateType"=>"Updated"}, {"date"=>"2016-03-14T17:02:02Z", "dateType"=>"Available"}, {"date"=>"2013", "dateType"=>"Issued"}]) expect(subject.publication_year).to eq("2013") expect(subject.publisher).to eq("UC Merced") - expect(subject.agency).to eq("DataCite") + expect(subject.agency).to eq("datacite") expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4") datacite = Maremma.from_xml(subject.datacite).fetch("resource", {}) expect(datacite.fetch("xsi:schemaLocation", "").split(" ").first).to eq("http://datacite.org/schema/kernel-4") expect(datacite.dig("creators", "creator", 0, "affiliation")).to eq(["UC Merced", "NSF"]) @@ -271,10 +271,10 @@ input = "https://doi.org/10.4124/05F6C379-DD68-4CDB-880D-33D3E9576D52/1" subject = Bolognese::Metadata.new(input: input, from: "datacite") expect(subject.valid?).to be false expect(subject.id).to eq("https://doi.org/10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1") expect(subject.doi).to eq("10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1") - expect(subject.agency).to eq("DataCite") + expect(subject.agency).to eq("datacite") expect(subject.state).to eq("not_found") datacite = Maremma.from_xml(subject.datacite).fetch("resource", {}) expect(datacite["identifier"]).to eq("identifierType"=>"DOI", "__content__"=>"10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1") expect(datacite["xmlns"]).to eq("http://datacite.org/schema/kernel-4") end