maremma 3.5.10 → 3.5.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/lib/maremma.rb +0 -16
- data/lib/maremma/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Maremma/content_negotiation/redirects_to_URL.yml +12 -440
- data/spec/fixtures/vcr_cassettes/Maremma/content_negotiation/returns_content_as_APA-formatted_citation.yml +76 -30
- data/spec/fixtures/vcr_cassettes/Maremma/content_negotiation/returns_content_as_bibtex.yml +83 -30
- data/spec/fixtures/vcr_cassettes/Maremma/get/get_json_with_params.yml +11 -546
- data/spec/fixtures/vcr_cassettes/Maremma/link_headers/parses_link_headers.yml +20 -523
- data/spec/maremma_spec.rb +13 -5
- metadata +2 -2
data/spec/maremma_spec.rb
CHANGED
@@ -45,9 +45,9 @@ describe Maremma do
|
|
45
45
|
expect(url).to eq("https://search.datacite.org/api?q=*%3A*&fl=doi%2Ctitle%2Cdescription%2Cpublisher%2CpublicationYear%2CresourceType%2CresourceTypeGeneral%2CrightsURI%2Cdatacentre_symbol%2Cxml%2Cminted%2Cupdated&fq=has_metadata%3Atrue&fq=is_active%3Atrue&facet=true&facet.field=resourceType_facet&facet.field=publicationYear&facet.field=datacentre_facet&facet.limit=10&f.resourceType_facet.facet.limit=15&wt=json")
|
46
46
|
response = subject.get(url)
|
47
47
|
facet_fields = response.body.fetch("data", {}).fetch("facet_counts", {}).fetch("facet_fields", {})
|
48
|
-
expect(facet_fields["datacentre_facet"].each_slice(2).first).to eq(["
|
49
|
-
expect(facet_fields["resourceType_facet"].each_slice(2).first).to eq(["Dataset",
|
50
|
-
expect(facet_fields["publicationYear"].each_slice(2).first).to eq(["2015",
|
48
|
+
expect(facet_fields["datacentre_facet"].each_slice(2).first).to eq(["BL.CCDC - The Cambridge Crystallographic Data Centre", 673412])
|
49
|
+
expect(facet_fields["resourceType_facet"].each_slice(2).first).to eq(["Dataset", 3400468])
|
50
|
+
expect(facet_fields["publicationYear"].each_slice(2).first).to eq(["2015", 1493468])
|
51
51
|
end
|
52
52
|
|
53
53
|
it "get json with meta hash" do
|
@@ -402,13 +402,21 @@ describe Maremma do
|
|
402
402
|
it "returns content as bibtex", vcr: true do
|
403
403
|
url = "https://doi.org/10.5281/ZENODO.21430"
|
404
404
|
response = subject.get(url, accept: "application/x-bibtex")
|
405
|
-
expect(response.body.fetch("data", nil)).to eq("@misc{https://doi.org/10.5281/
|
405
|
+
expect(response.body.fetch("data", nil)).to eq("@misc{https://doi.org/10.5281/zenodo.21430,
|
406
|
+
doi = {10.5281/zenodo.21430},
|
407
|
+
url = {http://zenodo.org/record/21430},
|
408
|
+
author = {Fenner, Martin and Ward, Karl Jonathan and {Gudmundur A. Thorisson} and Peters, Robert},
|
409
|
+
keywords = {orcid, datacite, ruby},
|
410
|
+
title = {DataCite-ORCID: 1.0},
|
411
|
+
publisher = {Zenodo},
|
412
|
+
year = {2015}
|
413
|
+
}")
|
406
414
|
end
|
407
415
|
|
408
416
|
it "returns content as APA-formatted citation", vcr: true do
|
409
417
|
url = "https://doi.org/10.5281/ZENODO.21430"
|
410
418
|
response = subject.get(url, accept: "text/x-bibliography; style=apa")
|
411
|
-
expect(response.body.fetch("data", nil)).to eq("
|
419
|
+
expect(response.body.fetch("data", nil)).to eq("Fenner, M., Ward, K. J., Gudmundur A. Thorisson, & Peters, R. (2015, July 25). DataCite-ORCID: 1.0. Zenodo. https://doi.org/10.5281/zenodo.21430")
|
412
420
|
end
|
413
421
|
end
|
414
422
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maremma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|