2727 when_i_choose_to_keep_the_duplicate_record
2828 and_i_confirm_my_selection
2929 then_i_should_see_a_success_message
30+ and_i_should_return_to_the_import_page
3031 and_the_first_duplicate_record_should_be_persisted
3132
32- when_i_review_the_second_duplicate_record
33+ when_i_visit_the_import_issues_page
34+ and_i_review_the_second_duplicate_record
3335 then_i_should_see_the_second_duplicate_record
3436
3537 when_i_choose_to_keep_the_previously_uploaded_record
3638 and_i_confirm_my_selection
3739 then_i_should_see_a_success_message
3840 and_the_second_record_should_not_be_updated
3941
40- when_i_review_the_third_duplicate_record
42+ when_i_visit_the_import_issues_page
43+ and_i_review_the_third_duplicate_record
4144 then_i_should_see_the_third_duplicate_record
4245
4346 when_i_choose_to_keep_both_records
7578 when_i_choose_to_keep_the_duplicate_record
7679 and_i_confirm_my_selection
7780 then_i_should_see_a_success_message
81+ and_i_should_return_to_the_import_page
7882 and_the_first_duplicate_record_should_be_persisted
7983
80- when_i_review_the_second_duplicate_record
84+ when_i_visit_the_import_issues_page
85+ and_i_review_the_second_duplicate_record
8186 then_i_should_see_the_second_duplicate_record
8287
8388 when_i_choose_to_keep_the_previously_uploaded_record
8489 and_i_confirm_my_selection
8590 then_i_should_see_a_success_message
8691 and_the_second_record_should_not_be_updated
8792
88- when_i_review_the_third_duplicate_record
93+ when_i_visit_the_import_issues_page
94+ and_i_review_the_third_duplicate_record
8995 then_i_should_see_the_third_duplicate_record
9096
9197 when_i_choose_to_keep_both_records
132138 and_i_choose_to_keep_the_duplicate_record
133139 and_i_confirm_my_selection
134140 then_search_vaccination_records_in_nhs_job_should_be_enqueued
141+ and_i_should_return_to_the_import_page
135142
136- when_i_review_the_second_duplicate_record_jimmy
143+ when_i_visit_the_import_issues_page
144+ and_i_review_the_second_duplicate_record_jimmy
137145 and_i_choose_to_keep_the_previously_uploaded_record
138146 and_i_confirm_my_selection
139147 then_search_vaccination_records_in_nhs_job_should_be_enqueued_for_second_patient
@@ -272,6 +280,10 @@ def when_i_visit_the_import_page
272280 click_link "Import" , match : :first
273281 end
274282
283+ def when_i_visit_the_import_issues_page
284+ visit imports_issues_path
285+ end
286+
275287 def and_i_start_adding_children_to_the_cohort
276288 click_button "Upload records"
277289 choose "Child records"
@@ -325,6 +337,7 @@ def when_i_choose_to_keep_both_records
325337 def when_i_choose_to_keep_the_previously_uploaded_record
326338 choose "Keep existing child"
327339 end
340+
328341 alias_method :and_i_choose_to_keep_the_previously_uploaded_record ,
329342 :when_i_choose_to_keep_the_previously_uploaded_record
330343
@@ -341,6 +354,11 @@ def then_i_should_see_a_success_message
341354 expect ( page ) . to have_content ( "Record updated" )
342355 end
343356
357+ def and_i_should_return_to_the_import_page
358+ cohort_import = CohortImport . order ( :created_at ) . last
359+ expect ( page ) . to have_current_path ( cohort_import_path ( cohort_import ) )
360+ end
361+
344362 def when_i_review_the_first_duplicate_record
345363 find ( ".nhsuk-details__summary" , text : "3 upload issues" ) . click
346364 click_on "Review CLARKE, Jennifer"
@@ -363,11 +381,11 @@ def then_i_should_see_a_validation_error
363381 expect ( page ) . to have_content ( "There is a problem" )
364382 end
365383
366- def when_i_review_the_second_duplicate_record
384+ def and_i_review_the_second_duplicate_record
367385 click_on "Review SMITH, James"
368386 end
369387
370- def when_i_review_the_second_duplicate_record_jimmy
388+ def and_i_review_the_second_duplicate_record_jimmy
371389 click_on "Review SMITH, Jimmy"
372390 end
373391
@@ -410,7 +428,7 @@ def and_a_new_patient_record_should_be_created
410428 expect ( session ) . to eq ( @session )
411429 end
412430
413- def when_i_review_the_third_duplicate_record
431+ def and_i_review_the_third_duplicate_record
414432 click_on "Review DOE, Mark"
415433 end
416434
0 commit comments