spec/sitemap_spec.rb in maltese-0.9.5 vs spec/sitemap_spec.rb in maltese-0.9.6
- old
+ new
@@ -1,11 +1,11 @@
require 'spec_helper'
describe Maltese::Sitemap, vcr: true do
subject { Maltese::Sitemap.new(rack_env: "test") }
- let(:doi) { "10.3280/ses2013-001015en" }
+ let(:doi) { "10.0166/fk2.stagefigshare.c.2794104" }
context "get_query_url" do
it "default" do
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")
end
@@ -19,18 +19,18 @@
end
end
context "get_total" do
it "with works" do
- expect(subject.get_total).to eq(846853)
+ expect(subject.get_total).to eq(896469)
end
end
context "queue_jobs" do
it "should report if there are works returned by the Datacite REST API" do
response = subject.queue_jobs
- expect(response).to eq(895955)
+ expect(response).to eq(896469)
end
end
context "process_data" do
it "should handle timeout errors with the Datacite REST API" do
@@ -53,10 +53,10 @@
end
context "get_data" do
it "should report if there are works returned by the Datacite REST API" do
response = subject.get_data(subject.get_query_url)
- expect(response.body.dig("meta", "total")).to eq(846839)
+ expect(response.body.dig("meta", "total")).to eq(896469)
expect(response.body.fetch("data", []).size).to eq(1000)
doc = response.body.fetch("data", []).first
expect(doc.dig("attributes", "doi")).to eq(doi)
end