Skip to content

Commit

Permalink
Merge pull request #114 from datacite/queue-failed-claims
Browse files Browse the repository at this point in the history
Changes queue_claim_jobs to select failed claims rather than ignored
  • Loading branch information
codycooperross authored Sep 6, 2022
2 parents 6906c2c + e6edcc0 commit 289fa78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def collect_data(options = {})

def queue_claim_jobs
# claims.notified.find_each { |claim| claim.queue_claim_job }
claims.ignored.find_each(&:queue_claim_job)
claims.failed.find_each(&:queue_claim_job)
end

def get_data(options = {})
Expand Down
6 changes: 3 additions & 3 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@
end
end

describe "claims from notifications" do
describe "claims from failed" do
subject { FactoryBot.create(:valid_user) }

let!(:claim) { FactoryBot.create(:claim, user: subject, orcid: "0000-0001-6528-2027", doi: "10.6084/M9.FIGSHARE.1041821", state: "notified") }
let!(:claim) { FactoryBot.create(:claim, user: subject, orcid: "0000-0001-6528-2027", doi: "10.6084/M9.FIGSHARE.1041821", state: "failed") }

it "queue_claims_jobs" do
subject.queue_claim_jobs
expect(subject.claims.count).to eq(1)
updated_claim = subject.claims.first
expect(updated_claim.state).to eq("notified")
expect(updated_claim.state).to eq("failed")
end
end
end

0 comments on commit 289fa78

Please sign in to comment.