Skip to content

Commit

Permalink
Record failure to find missing DOI (#699)
Browse files Browse the repository at this point in the history
* Record failure to find missing DOI

We’ll need publications that hit this branch of the DOI verification
logic to be manually reviewed by an admin, so we need to set the flag
appropriately to make that happen.

* Rubocop

---------

Co-authored-by: Alex Kiessling <[email protected]>
  • Loading branch information
EricDurante and ajkiessl authored Feb 15, 2023
1 parent fb09c0a commit d4a4d4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions app/jobs/doi_verification_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def perform(publication_id)
response = UnpaywallClient.query_unpaywall(publication)
if publication.matchable_title == response.matchable_title && response.doi.present?
publication.update!(doi: response.doi, doi_verified: true)
else
publication.update!(doi_verified: false)
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/component/jobs/doi_verification_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
expect(publication.reload.doi).to be_nil
end

it 'does not update the doi verification' do
expect(publication.reload.doi_verified).to be_nil
it 'updates the doi verification to false' do
expect(publication.reload.doi_verified).to be false
end
end
end
Expand All @@ -83,8 +83,8 @@
expect(publication.reload.doi).to be_nil
end

it 'does not update the doi verification' do
expect(publication.reload.doi_verified).to be_nil
it 'updates the doi verification to false' do
expect(publication.reload.doi_verified).to be false
end
end
end
Expand Down

0 comments on commit d4a4d4a

Please sign in to comment.