Skip to content

Commit

Permalink
added kaminari gem. #datacite/poodle#33
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 17, 2020
1 parent c5bc107 commit 9302127
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 40 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ gem "rack-utf8_sanitizer", "~> 1.6"
gem "turnout", "~> 2.5"
gem "audited", "~> 4.8"
gem "git", "~> 1.5"
gem "graphql", "~> 1.9", ">= 1.9.16"
gem "graphql", "~> 1.9.16"
gem "graphql-errors", "~> 0.4.0"
gem "graphql-batch", "~> 0.4.1"
gem "batch-loader", "~> 1.4", ">= 1.4.1"
Expand All @@ -71,6 +71,7 @@ gem 'strong_migrations', '~> 0.6.0'
gem 'crawler_detect'
gem 'lhm', '~> 2.2'
gem 'kt-paperclip', '~> 6.2', '>= 6.2.2'
gem 'kaminari', '~> 1.2'

group :development, :test do
gem "rspec-rails", "~> 3.8", ">= 3.8.2"
Expand Down
46 changes: 23 additions & 23 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,24 @@ GEM
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
ansi (1.5.0)
apollo-federation (1.0.3)
apollo-federation (1.0.4)
google-protobuf (~> 3.7)
graphql (~> 1.9.8)
graphql (>= 1.9.8)
arel (9.0.0)
ast (2.4.0)
audited (4.9.0)
activerecord (>= 4.2, < 6.1)
aws-eventstream (1.0.3)
aws-partitions (1.289.0)
aws-sdk-core (3.92.0)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-eventstream (1.1.0)
aws-partitions (1.297.0)
aws-sdk-core (3.94.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.30.0)
aws-sdk-core (~> 3, >= 3.71.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.61.1)
aws-sdk-s3 (1.61.2)
aws-sdk-core (~> 3, >= 3.83.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
Expand Down Expand Up @@ -98,7 +98,7 @@ GEM
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
bibtex-ruby (5.1.2)
bibtex-ruby (5.1.4)
latex-decode (~> 0.0)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
Expand Down Expand Up @@ -135,7 +135,7 @@ GEM
uniform_notifier (~> 1.11)
byebug (11.1.1)
cancancan (2.3.0)
capybara (3.31.0)
capybara (3.32.1)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
Expand Down Expand Up @@ -175,7 +175,7 @@ GEM
css_parser (1.7.1)
addressable
dalli (2.7.10)
database_cleaner (1.8.3)
database_cleaner (1.8.4)
ddtrace (0.32.0)
msgpack
debug_inspector (0.0.3)
Expand All @@ -199,11 +199,11 @@ GEM
elasticsearch-extensions (0.0.31)
ansi
elasticsearch
elasticsearch-model (7.0.0)
elasticsearch-model (7.1.0)
activesupport (> 3)
elasticsearch (> 1)
hashie
elasticsearch-rails (7.0.0)
elasticsearch-rails (7.1.0)
elasticsearch-transport (7.1.0)
faraday
multi_json
Expand Down Expand Up @@ -308,7 +308,7 @@ 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)
macaddr (1.7.2)
Expand Down Expand Up @@ -350,12 +350,12 @@ GEM
nio4r (2.5.2)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
oj (3.10.5)
oj (3.10.6)
oj_mimic_json (1.0.1)
optimist (3.0.0)
pandoc-ruby (2.1.4)
parallel (1.19.1)
parser (2.7.0.5)
parser (2.7.1.1)
ast (~> 2.4.0)
postrank-uri (1.0.24)
addressable (>= 2.4.0)
Expand Down Expand Up @@ -450,7 +450,7 @@ GEM
rspec-expectations (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-graphql_matchers (1.2)
rspec-graphql_matchers (1.2.1)
graphql (>= 1.8, < 2.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
Expand All @@ -473,7 +473,7 @@ GEM
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-performance (1.5.2)
rubocop (>= 0.71.0)
rubocop-rails (2.5.0)
rubocop-rails (2.5.2)
activesupport
rack (>= 1.1)
rubocop (>= 0.72.0)
Expand Down Expand Up @@ -515,9 +515,9 @@ GEM
sprockets (>= 3.0.0)
string_pattern (2.2.2)
regexp_parser (~> 1.3, >= 1.3.0)
strip_attributes (1.9.2)
strip_attributes (1.11.0)
activemodel (>= 3.0, < 7.0)
strong_migrations (0.6.2)
strong_migrations (0.6.4)
activerecord (>= 5)
sxp (1.1.0)
rdf (~> 3.1)
Expand All @@ -535,11 +535,11 @@ GEM
rack (>= 1.3, < 3)
rack-accept (~> 0.4)
tilt (>= 1.4, < 3)
tzinfo (1.2.6)
tzinfo (1.2.7)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.6)
unf_ext (0.0.7.7)
unicode-display_width (1.6.1)
unicode_utils (1.4.0)
uniform_notifier (1.13.0)
Expand Down Expand Up @@ -603,15 +603,15 @@ DEPENDENCIES
gender_detector (~> 0.1.2)
git (~> 1.5)
google-protobuf (= 3.10.0.rc.1)
graphql (~> 1.9, >= 1.9.16)
graphql (~> 1.9.16)
graphql-batch (~> 0.4.1)
graphql-cache (~> 0.6.0)
graphql-errors (~> 0.4.0)
hashdiff (>= 1.0.0.beta1, < 2.0.0)
iso8601 (~> 0.9.0)
jsonlint (~> 0.3.0)
jwt
kaminari (~> 1.0, >= 1.0.1)
kaminari (~> 1.2)
kt-paperclip (~> 6.2, >= 6.2.2)
lhm (~> 2.2)
listen (>= 3.0.5, < 3.2)
Expand Down
28 changes: 12 additions & 16 deletions spec/requests/media_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,18 @@
let(:media_type) { "application/xml" }
let(:url) { "https://example.org" }

# describe 'GET /dois/DOI/media' do
# it 'returns media' do
# get "/dois/#{doi.doi}/media", nil, headers

# expect(json).not_to be_empty
# expect(json['data'].size).to eq(6)
# result = json['data'].first
# expect(result.dig("attributes", "mediaType")).to eq("application/json")
# end

# it 'returns status code 200' do
# get "/dois/#{doi.doi}/media", nil, headers

# expect(last_response.status).to eq(200)
# end
# end
describe 'GET /dois/DOI/media' do
it 'returns media' do
get "/dois/#{doi.doi}/media", nil, headers

puts last_response.body
expect(last_response.status).to eq(200)
expect(json).not_to be_empty
expect(json['data'].size).to eq(6)
result = json['data'].first
expect(result.dig("attributes", "mediaType")).to eq("application/json")
end
end

describe 'GET /media query by doi not found' do
it 'returns media' do
Expand Down

0 comments on commit 9302127

Please sign in to comment.