Skip to content

Commit 63faab8

Browse files
committed
Add more assertions to specs
Based on review feedback this is to cover datetime and date-only cases Jira-Issue: MAV-2848 Jira-Issue: MAV-3392
1 parent 5cfe055 commit 63faab8

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

spec/features/mmr_already_had_spec.rb

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
expect(page).to have_content("LocationUnknown")
3737
and_had_been_vaccinated_with_mmr
3838
and_the_dose_number_is_first
39+
and_the_performed_at_date_only_is_set
3940
and_the_consent_requests_are_sent
4041
then_the_parent_doesnt_receive_a_consent_request
4142
end
@@ -72,7 +73,7 @@
7273
when_i_choose_mmrv_and_continue
7374
then_i_see_the_mmrv_date_page
7475

75-
when_i_fill_in_the_date_and_continue
76+
when_i_fill_in_the_date_and_time_and_continue
7677
then_i_see_the_confirmation_page
7778
and_the_confirmation_summary_is_not_displayed_as_a_warning
7879

@@ -83,6 +84,7 @@
8384
and_i_see_that_the_reporter_is_set
8485
and_had_been_vaccinated_with_mmrv
8586
and_the_dose_number_is_second
87+
and_the_performed_at_date_and_time_are_set
8688
and_the_consent_requests_are_sent
8789
then_the_parent_doesnt_receive_a_consent_request
8890
end
@@ -207,6 +209,16 @@ def then_i_see_the_mmr_date_instead_of_the_mmr_or_mmrv_page
207209
expect(page).to have_content("When was the MMR(V) vaccination given?")
208210
end
209211

212+
def when_i_fill_in_the_date_and_time_and_continue
213+
@vaccination_date = 6.months.ago.to_date
214+
fill_in "Day", with: @vaccination_date.day
215+
fill_in "Month", with: @vaccination_date.month
216+
fill_in "Year", with: @vaccination_date.year
217+
fill_in "Hour", with: "12"
218+
fill_in "Minute", with: "30"
219+
click_on "Continue"
220+
end
221+
210222
def when_i_fill_in_the_date_and_continue
211223
@vaccination_date = 6.months.ago.to_date
212224
fill_in "Day", with: @vaccination_date.day
@@ -281,6 +293,15 @@ def and_the_dose_number_is_second
281293
expect(vaccination_record.dose_sequence).to be(2)
282294
end
283295

296+
def and_the_performed_at_date_and_time_are_set
297+
expect(page).to have_content("Date#{@vaccination_date.strftime('%-d %B %Y')}")
298+
expect(page).to have_content("Time12:30")
299+
end
300+
301+
def and_the_performed_at_date_only_is_set
302+
expect(page).to have_content("Date#{@vaccination_date.strftime('%-d %B %Y')}")
303+
end
304+
284305
def and_the_consent_requests_are_sent
285306
EnqueueSchoolConsentRequestsJob.perform_now
286307
perform_enqueued_jobs

0 commit comments

Comments
 (0)