Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jul 20, 2019
1 parent 3dbe829 commit 3c394b8
Show file tree
Hide file tree
Showing 176 changed files with 106 additions and 21,343 deletions.
40 changes: 23 additions & 17 deletions spec/concerns/crosscitable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
expect(meta["from"]).to eq("datacite")
expect(meta["doi"]).to eq("10.5061/dryad.8515")
expect(meta["creators"].length).to eq(8)
expect(meta["creators"].first).to eq("familyName"=>"Ollomo", "givenName"=>"Benjamin", "name"=>"Ollomo, Benjamin", "nameType"=>"Personal")
expect(meta["creators"].first).to eq("familyName"=>"Ollomo", "givenName"=>"Benjamin", "name"=>"Ollomo, Benjamin", "nameType"=>"Personal", "nameIdentifiers" => [], "affiliation" => [])
expect(meta["titles"]).to eq([{"title"=>"Data from: A new malaria agent in African hominids."}])
expect(meta["publication_year"]).to eq("2011")
expect(meta["publisher"]).to eq("Dryad Digital Repository")
Expand All @@ -179,10 +179,10 @@
expect(meta["string"]).to eq(string)
expect(meta["from"]).to eq("datacite")
expect(meta["doi"]).to eq("10.14454/testpub")
expect(meta["creators"]).to eq([{"familyName"=>"Smith", "givenName"=>"John", "name"=>"Smith, John", "nameType"=>"Personal"}, {"name"=>"つまらないものですが", "nameIdentifiers"=>
expect(meta["creators"]).to eq([{"familyName"=>"Smith", "givenName"=>"John", "name"=>"Smith, John", "nameType"=>"Personal", "nameIdentifiers" => [], "affiliation" => []}, {"name"=>"つまらないものですが", "nameIdentifiers"=>
[{"nameIdentifier"=>"abc123",
"nameIdentifierScheme"=>"ISNI",
"schemeUri"=>"Other"}]}])
"nameIdentifierScheme"=>"ISNI"}],
"affiliation" => []}])
expect(meta["titles"]).to eq([{"title"=>"Właściwości rzutowań podprzestrzeniowych"}, {"title"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
expect(meta["publication_year"]).to eq("2010")
expect(meta["publisher"]).to eq("Springer")
Expand Down Expand Up @@ -246,15 +246,21 @@
end

it "from datacite url" do
string = "https://doi.org/10.7272/q6g15xs4"
string = "10.14454/1x4x-9056"
meta = subject.parse_xml(string)
puts meta
expect(meta["from"]).to eq("datacite")
expect(meta["doi"]).to eq("10.7272/q6g15xs4")
expect(meta["creators"].length).to eq(2)
expect(meta["creators"].first).to eq("affiliation"=>[{"name"=>"UC San Francisco"}], "familyName"=>"Rodriguez", "givenName"=>"Robert", "name"=>"Rodriguez, Robert", "nameType"=>"Personal")
expect(meta["titles"]).to eq([{"title"=>"NEXUS Head CT"}])
expect(meta["publication_year"]).to eq("2017")
expect(meta["publisher"]).to eq("UC San Francisco")
expect(meta["doi"]).to eq("10.14454/1x4x-9056")
expect(meta["creators"].length).to eq(1)
expect(meta["creators"].first).to eq("affiliation" => [{"affiliationIdentifier"=>"https://ror.org/04wxnsj81", "affiliationIdentifierScheme"=>"ROR", "name"=>"DataCite"}],
"familyName" => "Fenner",
"givenName" => "Martin",
"name" => "Fenner, Martin",
"nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2405", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],
"nameType" => "Personal")
expect(meta["titles"]).to eq([{"title"=>"Cool DOI's"}])
expect(meta["publication_year"]).to eq("2016")
expect(meta["publisher"]).to eq("DataCite")
expect(meta["agency"]).to eq("DataCite")
end

Expand All @@ -281,7 +287,7 @@
expect(meta["from"]).to eq("ris")
expect(meta["doi"]).to eq("10.7554/elife.01567")
expect(meta["creators"].length).to eq(5)
expect(meta["creators"].first).to eq("familyName"=>"Sankar", "givenName"=>"Martial", "name"=>"Sankar, Martial", "nameType"=>"Personal")
expect(meta["creators"].first).to eq("familyName"=>"Sankar", "givenName"=>"Martial", "name"=>"Sankar, Martial", "nameType"=>"Personal", "nameIdentifiers" => [], "affiliation" => [])
expect(meta["titles"]).to eq([{"title"=>"Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth"}])
expect(meta["publication_year"]).to eq("2014")
expect(meta["publisher"]).to eq("(:unav)")
Expand Down Expand Up @@ -358,7 +364,7 @@

expect(meta["doi"]).to eq("10.5061/dryad.8515")
expect(meta["creators"].length).to eq(8)
expect(meta["creators"].first).to eq("familyName"=>"Ollomo", "givenName"=>"Benjamin", "name"=>"Ollomo, Benjamin", "nameType"=>"Personal")
expect(meta["creators"].first).to eq("familyName"=>"Ollomo", "givenName"=>"Benjamin", "name"=>"Ollomo, Benjamin", "nameType"=>"Personal", "nameIdentifiers" => [], "affiliation" => [])
expect(meta["titles"]).to eq([{"title"=>"Data from: A new malaria agent in African hominids."}])
expect(meta["publication_year"]).to eq("2011")
expect(meta["publisher"]).to eq("Dryad Digital Repository")
Expand All @@ -369,10 +375,10 @@
meta = subject.parse_xml(string)

expect(meta["doi"]).to eq("10.14454/testpub")
expect(meta["creators"]).to eq([{"familyName"=>"Smith", "givenName"=>"John", "name"=>"Smith, John", "nameType"=>"Personal"}, {"name"=>"つまらないものですが", "nameIdentifiers"=>
expect(meta["creators"]).to eq([{"familyName"=>"Smith", "givenName"=>"John", "name"=>"Smith, John", "nameType"=>"Personal", "nameIdentifiers" => [], "affiliation" => []}, {"name"=>"つまらないものですが", "nameIdentifiers"=>
[{"nameIdentifier"=>"abc123",
"nameIdentifierScheme"=>"ISNI",
"schemeUri"=>"Other"}]}])
"nameIdentifierScheme"=>"ISNI"}],
"affiliation" => []}])
expect(meta["titles"]).to eq([{"title"=>"Właściwości rzutowań podprzestrzeniowych"}, {"title"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
expect(meta["publication_year"]).to eq("2010")
expect(meta["publisher"]).to eq("Springer")
Expand Down Expand Up @@ -421,7 +427,7 @@

expect(meta["doi"]).to eq("10.7554/elife.01567")
expect(meta["creators"].length).to eq(5)
expect(meta["creators"].first).to eq("familyName"=>"Sankar", "givenName"=>"Martial", "name"=>"Sankar, Martial", "nameType"=>"Personal")
expect(meta["creators"].first).to eq("familyName"=>"Sankar", "givenName"=>"Martial", "name"=>"Sankar, Martial", "nameType"=>"Personal", "nameIdentifiers" => [], "affiliation" => [])
expect(meta["titles"]).to eq([{"title"=>"Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth"}])
expect(meta["publication_year"]).to eq("2014")
expect(meta["publisher"]).to eq("(:unav)")
Expand Down
4 changes: 2 additions & 2 deletions spec/concerns/helpable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
response = subject.get_url

expect(response.body.dig("data", "responseCode")).to eq(1)
expect(response.body.dig("data", "values")).to eq([{"index"=>1, "type"=>"URL", "data"=>{"format"=>"string", "value"=>"https://blog.datacite.org/re3data-science-europe/"}, "ttl"=>86400, "timestamp"=>"2018-09-26T08:52:02Z"}])
expect(response.body.dig("data", "values")).to eq([{"index"=>1, "type"=>"URL", "data"=>{"format"=>"string", "value"=>"https://blog.datacite.org/re3data-science-europe/"}, "ttl"=>86400, "timestamp"=>"2019-07-20T08:59:55Z"}])
end

it 'draft doi' do
Expand All @@ -145,7 +145,7 @@
it 'should get dois' do
options = { prefix: "10.5438", username: client.symbol, password: client.password, role_id: "client_admin" }
dois = Doi.get_dois(options)
expect(dois.length).to eq(442)
expect(dois.length).to eq(443)
expect(dois.first).to eq("10.5438/0000-00SS")
end

Expand Down

This file was deleted.

73 changes: 0 additions & 73 deletions spec/fixtures/vcr_cassettes/Doi/change_metadata/author.yml

This file was deleted.

73 changes: 0 additions & 73 deletions spec/fixtures/vcr_cassettes/Doi/change_metadata/date_published.yml

This file was deleted.

Loading

0 comments on commit 3c394b8

Please sign in to comment.