maltese 0.8.10 → 0.8.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +1 -1
- data/Gemfile.lock +1 -1
- data/lib/maltese/sitemap.rb +1 -1
- data/lib/maltese/version.rb +1 -1
- data/spec/cli_spec.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Maltese_CLI/sitemap/should_succeed.yml +26 -26
- data/spec/fixtures/vcr_cassettes/Maltese_Sitemap/get_data/should_report_if_there_are_works_returned_by_the_Datacite_REST_API.yml +7 -7
- data/spec/fixtures/vcr_cassettes/Maltese_Sitemap/get_total/with_works.yml +7 -7
- data/spec/fixtures/vcr_cassettes/Maltese_Sitemap/push_data/should_report_if_there_are_no_works_returned_by_the_Datacite_REST_API.yml +12 -12
- data/spec/fixtures/vcr_cassettes/Maltese_Sitemap/push_data/should_report_if_there_are_works_returned_by_the_Datacite_REST_API.yml +12 -12
- data/spec/fixtures/vcr_cassettes/Maltese_Sitemap/queue_jobs/should_report_if_there_are_works_returned_by_the_Datacite_REST_API.yml +26 -26
- data/spec/sitemap_spec.rb +7 -7
- metadata +1 -1
data/spec/sitemap_spec.rb
CHANGED
@@ -3,39 +3,39 @@ require 'spec_helper'
|
|
3
3
|
describe Maltese::Sitemap, vcr: true do
|
4
4
|
subject { Maltese::Sitemap.new }
|
5
5
|
|
6
|
-
let(:doi) { "10.
|
6
|
+
let(:doi) { "10.1002/jca.21694" }
|
7
7
|
|
8
8
|
context "get_query_url" do
|
9
9
|
it "default" do
|
10
|
-
expect(subject.get_query_url).to eq("https://api.test.datacite.org/dois?fields%5Bdois%5D=doi%2Cupdated&page%5Bscroll%5D=
|
10
|
+
expect(subject.get_query_url).to eq("https://api.test.datacite.org/dois?fields%5Bdois%5D=doi%2Cupdated&page%5Bscroll%5D=7m&page%5Bsize%5D=1000")
|
11
11
|
end
|
12
12
|
|
13
13
|
it "with page[size] one" do
|
14
|
-
expect(subject.get_query_url(size: 1)).to eq("https://api.test.datacite.org/dois?fields%5Bdois%5D=doi%2Cupdated&page%5Bscroll%5D=
|
14
|
+
expect(subject.get_query_url(size: 1)).to eq("https://api.test.datacite.org/dois?fields%5Bdois%5D=doi%2Cupdated&page%5Bscroll%5D=7m&page%5Bsize%5D=1")
|
15
15
|
end
|
16
16
|
|
17
17
|
it "with size" do
|
18
|
-
expect(subject.get_query_url(size: 250)).to eq("https://api.test.datacite.org/dois?fields%5Bdois%5D=doi%2Cupdated&page%5Bscroll%5D=
|
18
|
+
expect(subject.get_query_url(size: 250)).to eq("https://api.test.datacite.org/dois?fields%5Bdois%5D=doi%2Cupdated&page%5Bscroll%5D=7m&page%5Bsize%5D=250")
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
22
|
context "get_total" do
|
23
23
|
it "with works" do
|
24
|
-
expect(subject.get_total).to eq(
|
24
|
+
expect(subject.get_total).to eq(833105)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
context "queue_jobs" do
|
29
29
|
it "should report if there are works returned by the Datacite REST API" do
|
30
30
|
response = subject.queue_jobs
|
31
|
-
expect(response).to eq(
|
31
|
+
expect(response).to eq(833085)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
35
|
context "get_data" do
|
36
36
|
it "should report if there are works returned by the Datacite REST API" do
|
37
37
|
response = subject.get_data(subject.get_query_url)
|
38
|
-
expect(response.body.dig("meta", "total")).to eq(
|
38
|
+
expect(response.body.dig("meta", "total")).to eq(833098)
|
39
39
|
expect(response.body.fetch("data", []).size).to eq(1000)
|
40
40
|
doc = response.body.fetch("data", []).first
|
41
41
|
expect(doc.dig("attributes", "doi")).to eq(doi)
|