diff --git a/app/models/immunisation_import_row.rb b/app/models/immunisation_import_row.rb index a7e54afac..472567075 100644 --- a/app/models/immunisation_import_row.rb +++ b/app/models/immunisation_import_row.rb @@ -380,14 +380,13 @@ def date_of_birth_in_a_valid_year_group end def find_existing_patients - @find_existing_patients ||= - Patient.find_existing( - nhs_number: patient_nhs_number, - first_name: patient_first_name, - last_name: patient_last_name, - date_of_birth: patient_date_of_birth, - address_postcode: patient_postcode - ) + Patient.find_existing( + nhs_number: patient_nhs_number, + first_name: patient_first_name, + last_name: patient_last_name, + date_of_birth: patient_date_of_birth, + address_postcode: patient_postcode + ) end def zero_or_one_existing_patient diff --git a/spec/features/dev_reset_team_spec.rb b/spec/features/dev_reset_team_spec.rb index 9a6975e54..120810c57 100644 --- a/spec/features/dev_reset_team_spec.rb +++ b/spec/features/dev_reset_team_spec.rb @@ -62,7 +62,7 @@ def and_vaccination_records_have_been_imported ) click_on "Upload records" - expect(VaccinationRecord.count).to eq(7) + expect(VaccinationRecord.count).to eq(8) end def then_all_associated_data_is_deleted_when_i_reset_the_team @@ -71,7 +71,7 @@ def then_all_associated_data_is_deleted_when_i_reset_the_team .by(-10) .and(change(Cohort, :count).by(-2)) .and(change(Parent, :count).by(-3)) - .and(change(VaccinationRecord, :count).by(-7)) + .and(change(VaccinationRecord, :count).by(-8)) .and(change(ImmunisationImport, :count).by(-1)) .and(change(CohortImport, :count).by(-1)) ) diff --git a/spec/features/import_vaccination_records_spec.rb b/spec/features/import_vaccination_records_spec.rb index b690282cc..a760fa34c 100644 --- a/spec/features/import_vaccination_records_spec.rb +++ b/spec/features/import_vaccination_records_spec.rb @@ -136,7 +136,7 @@ def and_i_upload_a_valid_file end def then_i_should_see_the_success_heading - expect(page).to have_content("7 new vaccination records") + expect(page).to have_content("8 new vaccination records") end def then_i_should_see_the_vaccination_records diff --git a/spec/models/immunisation_import_spec.rb b/spec/models/immunisation_import_spec.rb index 2c5056eda..a79feb91d 100644 --- a/spec/models/immunisation_import_spec.rb +++ b/spec/models/immunisation_import_spec.rb @@ -180,9 +180,9 @@ .and change(immunisation_import.vaccination_records, :count).by(8) .and change(immunisation_import.locations, :count).by(1) .and change(immunisation_import.patients, :count).by(7) - .and change(immunisation_import.sessions, :count).by(2) - .and change(immunisation_import.patient_sessions, :count).by(7) - .and change(immunisation_import.batches, :count).by(5) + .and change(immunisation_import.sessions, :count).by(3) + .and change(immunisation_import.patient_sessions, :count).by(8) + .and change(immunisation_import.batches, :count).by(6) # Second import should not duplicate the vaccination records if they're # identical. @@ -202,7 +202,7 @@ # stree-ignore expect { process! } .to change(immunisation_import, :exact_duplicate_record_count).to(0) - .and change(immunisation_import, :new_record_count).to(7) + .and change(immunisation_import, :new_record_count).to(8) .and change(immunisation_import, :not_administered_record_count).to(0) end @@ -211,13 +211,13 @@ csv.rewind process! - expect(immunisation_import.exact_duplicate_record_count).to eq(7) + expect(immunisation_import.exact_duplicate_record_count).to eq(8) end it "creates a new session for each date" do process! - expect(immunisation_import.sessions.count).to eq(2) + expect(immunisation_import.sessions.count).to eq(3) session = immunisation_import.sessions.first expect(session.dates.map(&:value)).to contain_exactly( @@ -318,7 +318,7 @@ it "activates the patient sessions" do expect { record! }.to change(PatientSession.active, :count).from(0).to( - 7 + 8 ) end end