Skip to content

Commit

Permalink
more specs. #390
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 16, 2020
1 parent 66cb852 commit c939711
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
55 changes: 55 additions & 0 deletions spec/fixtures/vcr_cassettes/works/citations/has_citations_list.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions spec/requests/works_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@
expect(json.dig('data', 'attributes', 'view-count')).to eq(0)
expect(json.dig('data', 'attributes', 'download-count')).to eq(0)
end

it "has citations list" do
get "/works"

expect(last_response.status).to eq(200)
expect(json['data'].size).to eq(2)
expect(json.dig('meta', 'total')).to eq(2)
work = json['data'].first
expect(work.dig('attributes', 'doi')).to eq(doi.doi.downcase)
expect(work.dig('attributes', 'title')).to eq("Data from: A new malaria agent in African hominids.")
expect(work.dig('attributes', 'citation-count')).to eq(1)
expect(work.dig('attributes', 'view-count')).to eq(0)
expect(work.dig('attributes', 'download-count')).to eq(0)
end
end

describe 'GET /works/:id', elasticsearch: true do
Expand Down

0 comments on commit c939711

Please sign in to comment.