Skip to content

Commit 0abb91d

Browse files
committed
Don't prompt for location when editing already vaccinated date
When you choose to edit the vaccination date from the confirmation page on the already vaccinated journey you should be redirected straight back to the confirmation page not to the location page. Jira-Issue: MAV-2848 Jira-Issue: MAV-3405
1 parent d96f6f7 commit 0abb91d

2 files changed

Lines changed: 50 additions & 1 deletion

File tree

app/models/draft_vaccination_record.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def wizard_steps
7474
(:dose if administered? && can_be_half_dose?),
7575
(:batch if administered?),
7676
(
77-
if session&.generic_clinic? || national_reporting_user_and_record?
77+
if !already_had? && (session&.generic_clinic? || national_reporting_user_and_record?)
7878
:location
7979
end
8080
),

spec/features/mmr_already_had_spec.rb

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,33 @@
6464
then_the_parent_doesnt_receive_a_consent_request
6565
end
6666

67+
scenario "record a patient as already had their 1st MMR dose and then edit dates" do
68+
given_an_mmr_programme_with_a_session
69+
and_a_patient_is_in_the_session_born_after_january_2020
70+
and_the_patient_doesnt_need_triage
71+
and_the_patient_has_not_had_a_first_dose
72+
73+
when_i_go_the_session
74+
then_i_see_one_patient_needing_consent
75+
and_i_click_on_the_patient
76+
then_i_see_the_patient_needs_consent
77+
78+
when_i_click_record_as_already_had_first_dose
79+
then_i_see_the_did_you_have_mmr_or_mmrv_page
80+
81+
when_i_choose_mmr_and_continue
82+
then_i_see_the_mmr_date_page
83+
84+
when_i_fill_in_the_date_and_time_and_continue
85+
then_i_see_the_confirmation_page
86+
87+
when_i_click_link_to_change_the_date
88+
then_i_see_the_mmr_date_page
89+
when_i_change_the_date_and_continue
90+
then_i_see_the_confirmation_page
91+
and_i_see_the_updated_date_in_the_summary
92+
end
93+
6794
scenario "record a patient born before January 2020 as already had their 1st MMR dose outside the school session" do
6895
given_an_mmr_programme_with_a_session
6996
and_a_patient_is_in_the_session_born_before_january_2020
@@ -341,4 +368,26 @@ def and_the_consent_requests_are_sent
341368
def then_the_parent_doesnt_receive_a_consent_request
342369
expect(EmailDeliveryJob.deliveries).to be_empty
343370
end
371+
372+
def when_i_click_link_to_change_the_date
373+
within(".nhsuk-summary-list__actions[contains('Change date')]") do
374+
click_on "Change"
375+
end
376+
end
377+
378+
def when_i_change_the_date_and_continue
379+
@vaccination_date += 1.day
380+
381+
fill_in "Day", with: @vaccination_date.day
382+
fill_in "Month", with: @vaccination_date.month
383+
fill_in "Year", with: @vaccination_date.year
384+
385+
click_on "Continue"
386+
end
387+
388+
def and_i_see_the_updated_date_in_the_summary
389+
expect(page).to have_content(
390+
"Date#{@vaccination_date.strftime("%-d %B %Y")}"
391+
)
392+
end
344393
end

0 commit comments

Comments
 (0)