Skip to content

Commit 2ad41c4

Browse files
authored
Merge pull request #5126 from nhsuk/revert-changeset-fallback
Change ProcessPatientChangesetJob to accept changeset id (part 2 of 2)
2 parents 92fefc2 + 6cf0b1a commit 2ad41c4

2 files changed

Lines changed: 1 addition & 29 deletions

File tree

app/jobs/process_patient_changeset_job.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ class ProcessPatientChangesetJob < ApplicationJob
44
queue_as :imports
55

66
def perform(patient_changeset_id)
7-
patient_changeset =
8-
if patient_changeset_id.is_a?(PatientChangeset)
9-
patient_changeset_id
10-
else
11-
PatientChangeset.find(patient_changeset_id)
12-
end
13-
7+
patient_changeset = PatientChangeset.find(patient_changeset_id)
148
return if patient_changeset.processed?
159

1610
unique_nhs_number = get_unique_nhs_number(patient_changeset)

spec/jobs/process_patient_changeset_job_spec.rb

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -221,27 +221,5 @@
221221
}.not_to have_enqueued_job(CommitImportJob)
222222
end
223223
end
224-
225-
context "when passed a PatientChangeset object" do
226-
let(:search_results) do
227-
[
228-
{
229-
"step" => "no_fuzzy_with_history",
230-
"result" => "one_match",
231-
"nhs_number" => "9449306168",
232-
"created_at" => Time.current.iso8601(3)
233-
}
234-
]
235-
end
236-
237-
it "processes the changeset correctly" do
238-
described_class.perform_now(patient_changeset)
239-
240-
expect(patient_changeset.reload).to be_processed
241-
expect(patient_changeset.child_attributes["nhs_number"]).to eq(
242-
"9449306168"
243-
)
244-
end
245-
end
246224
end
247225
end

0 commit comments

Comments
 (0)