Skip to content

Commit

Permalink
showing version is fixed via latest version of bolognese gem. datacit…
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed May 8, 2020
1 parent 76e7cbe commit 944e72b
Show file tree
Hide file tree
Showing 5 changed files with 255 additions and 104 deletions.
119 changes: 60 additions & 59 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.4.1)
actionpack (= 5.2.4.1)
actioncable (5.2.4.2)
actionpack (= 5.2.4.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.4.1)
actionpack (= 5.2.4.1)
actionview (= 5.2.4.1)
activejob (= 5.2.4.1)
actionmailer (5.2.4.2)
actionpack (= 5.2.4.2)
actionview (= 5.2.4.2)
activejob (= 5.2.4.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.4.1)
actionview (= 5.2.4.1)
activesupport (= 5.2.4.1)
actionpack (5.2.4.2)
actionview (= 5.2.4.2)
activesupport (= 5.2.4.2)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.4.1)
activesupport (= 5.2.4.1)
actionview (5.2.4.2)
activesupport (= 5.2.4.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.4.1)
activesupport (= 5.2.4.1)
activejob (5.2.4.2)
activesupport (= 5.2.4.2)
globalid (>= 0.3.6)
activemodel (5.2.4.1)
activesupport (= 5.2.4.1)
activerecord (5.2.4.1)
activemodel (= 5.2.4.1)
activesupport (= 5.2.4.1)
activemodel (5.2.4.2)
activesupport (= 5.2.4.2)
activerecord (5.2.4.2)
activemodel (= 5.2.4.2)
activesupport (= 5.2.4.2)
arel (>= 9.0)
activestorage (5.2.4.1)
actionpack (= 5.2.4.1)
activerecord (= 5.2.4.1)
activestorage (5.2.4.2)
actionpack (= 5.2.4.2)
activerecord (= 5.2.4.2)
marcel (~> 0.3.1)
activesupport (5.2.4.1)
activesupport (5.2.4.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
Expand All @@ -47,15 +47,15 @@ GEM
arel (9.0.0)
ast (2.4.0)
benchmark_methods (0.7)
better_errors (2.6.0)
better_errors (2.7.0)
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
bibtex-ruby (5.1.1)
bibtex-ruby (5.1.4)
latex-decode (~> 0.0)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
bolognese (1.5.15)
bolognese (1.5.21)
activesupport (>= 4.2.5)
benchmark_methods (~> 0.7)
bibtex-ruby (>= 5.1.0)
Expand All @@ -81,7 +81,7 @@ GEM
rdf-turtle (~> 3.1)
thor (~> 0.19)
builder (3.2.4)
capybara (3.31.0)
capybara (3.32.1)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
Expand Down Expand Up @@ -127,7 +127,7 @@ GEM
ffi (1.12.2)
gender_detector (0.1.2)
unicode_utils (>= 1.3.0)
git (1.6.0)
git (1.7.0)
rchardet (~> 1.8)
globalid (0.4.2)
activesupport (>= 4.2.0)
Expand All @@ -136,7 +136,7 @@ GEM
tilt
hamster (3.0.0)
concurrent-ruby (~> 1.0)
hashdiff (1.0.0)
hashdiff (1.0.1)
htmlentities (4.3.4)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
Expand All @@ -162,14 +162,14 @@ GEM
logstash-event (1.2.02)
logstash-logger (0.26.1)
logstash-event (~> 1.2)
loofah (2.4.0)
loofah (2.5.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
maremma (4.6)
maremma (4.7)
activesupport (>= 4.2.5)
addressable (>= 2.3.6)
builder (~> 3.2, >= 3.2.2)
Expand All @@ -180,22 +180,22 @@ GEM
nokogiri (~> 1.10.4)
oj (>= 2.8.3)
oj_mimic_json (~> 1.0, >= 1.0.1)
method_source (0.9.2)
mimemagic (0.3.4)
method_source (1.0.0)
mimemagic (0.3.5)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.14.0)
multi_json (1.14.1)
multipart-post (2.1.1)
namae (1.0.1)
nio4r (2.5.2)
nokogiri (1.10.8)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
oj (3.10.2)
oj (3.10.6)
oj_mimic_json (1.0.1)
optimist (3.0.0)
optimist (3.0.1)
parallel (1.19.1)
parser (2.7.0.2)
parser (2.7.1.2)
ast (~> 2.4.0)
postrank-uri (1.0.24)
addressable (>= 2.4.0)
Expand All @@ -207,33 +207,33 @@ GEM
rack (>= 2.0.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.4.1)
actioncable (= 5.2.4.1)
actionmailer (= 5.2.4.1)
actionpack (= 5.2.4.1)
actionview (= 5.2.4.1)
activejob (= 5.2.4.1)
activemodel (= 5.2.4.1)
activerecord (= 5.2.4.1)
activestorage (= 5.2.4.1)
activesupport (= 5.2.4.1)
rails (5.2.4.2)
actioncable (= 5.2.4.2)
actionmailer (= 5.2.4.2)
actionpack (= 5.2.4.2)
actionview (= 5.2.4.2)
activejob (= 5.2.4.2)
activemodel (= 5.2.4.2)
activerecord (= 5.2.4.2)
activestorage (= 5.2.4.2)
activesupport (= 5.2.4.2)
bundler (>= 1.3.0)
railties (= 5.2.4.1)
railties (= 5.2.4.2)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (5.2.4.1)
actionpack (= 5.2.4.1)
activesupport (= 5.2.4.1)
railties (5.2.4.2)
actionpack (= 5.2.4.2)
activesupport (= 5.2.4.2)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
rake (13.0.1)
rb-fsevent (0.10.3)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rchardet (1.8.0)
Expand Down Expand Up @@ -261,23 +261,23 @@ GEM
regexp_parser (1.7.0)
request_store (1.5.0)
rack (>= 1.4)
rspec-core (3.9.1)
rspec-support (~> 3.9.1)
rspec-expectations (3.9.0)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-rails (3.9.0)
rspec-rails (3.9.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.2)
rspec-support (3.9.3)
rubocop (0.77.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
Expand All @@ -287,7 +287,8 @@ GEM
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-performance (1.5.2)
rubocop (>= 0.71.0)
rubocop-rails (2.4.2)
rubocop-rails (2.5.2)
activesupport
rack (>= 1.1)
rubocop (>= 0.72.0)
ruby-progressbar (1.10.1)
Expand Down Expand Up @@ -316,12 +317,12 @@ GEM
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.10)
tzinfo (1.2.6)
tzinfo (1.2.7)
thread_safe (~> 0.1)
unicode-display_width (1.6.1)
unicode_utils (1.4.0)
vcr (3.0.3)
webmock (3.8.2)
webmock (3.8.3)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down
12 changes: 8 additions & 4 deletions spec/api/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,26 @@
end

context "application/vnd.datacite.datacite+xml" do
let(:doi) { "10.00012/uu01-ltej7x" }

it "header" do
get "/#{doi}", nil, { "HTTP_ACCEPT" => "application/vnd.datacite.datacite+xml" }

expect(last_response.status).to eq(200)
response = Maremma.from_xml(last_response.body).to_h.fetch("resource", {})
expect(response.dig("publisher")).to eq("DataCite")
expect(response.dig("titles", "title")).to eq("Announcing schema 4.2")
expect(response.dig("publisher")).to eq("Utrecht University")
expect(response.dig("titles", "title")).to eq("__content__"=>"Minimum: Title", "xml:lang"=>"en")
expect(response.dig("version")).to eq("Minimum: Version")
end

it "link" do
get "/application/vnd.datacite.datacite+xml/#{doi}"

expect(last_response.status).to eq(200)
response = Maremma.from_xml(last_response.body).to_h.fetch("resource", {})
expect(response.dig("publisher")).to eq("DataCite")
expect(response.dig("titles", "title")).to eq("Announcing schema 4.2")
expect(response.dig("publisher")).to eq("Utrecht University")
expect(response.dig("titles", "title")).to eq("__content__"=>"Minimum: Title", "xml:lang"=>"en")
expect(response.dig("version")).to eq("Minimum: Version")
end

it "not found" do
Expand Down
Loading

0 comments on commit 944e72b

Please sign in to comment.