Skip to content

Commit 3fa9bd3

Browse files
authored
Merge pull request #4251 from nhsuk/aged-out-job
Enqueue patient aged out of school job
2 parents 25dec1c + b18dfae commit 3fa9bd3

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

app/models/class_import.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,7 @@ def postprocess_rows!
7979
end
8080

8181
SchoolMove.import(school_moves, on_duplicate_key_ignore: true)
82+
83+
PatientsAgedOutOfSchoolJob.perform_later
8284
end
8385
end

app/models/cohort_import.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ def parse_row(data)
4444
end
4545

4646
def postprocess_rows!
47-
# Nothing to do.
47+
PatientsAgedOutOfSchoolJob.perform_later
4848
end
4949
end

spec/models/class_import_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@
281281
.on_queue(:imports)
282282
end
283283

284+
it "enqueues a job to move aged out patients" do
285+
expect { process! }.to have_enqueued_job(PatientsAgedOutOfSchoolJob).once
286+
end
287+
284288
context "with an existing patient matching the name" do
285289
let!(:patient) do
286290
create(

spec/models/cohort_import_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@
268268
).twice.on_queue(:imports)
269269
end
270270

271+
it "enqueues a job to move aged out patients" do
272+
expect { process! }.to have_enqueued_job(PatientsAgedOutOfSchoolJob).once
273+
end
274+
271275
context "when same NHS number appears multiple times in the file" do
272276
let(:file) { "duplicate_nhs_numbers.csv" }
273277

0 commit comments

Comments
 (0)