Skip to content

Commit a4ec95b

Browse files
committed
Fix flaky search form test
The test tries to create a vaccination record with a different programme to that currently being search across, however because the vaccination record factory picks programmes at random it's possible that sometimes the two programmes will match. There's a unique index on the type of programme meaning when two programmes of the same type are created we get a unique constraint failure.
1 parent 26d1997 commit a4ec95b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

spec/forms/search_form_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,8 @@
544544
create(
545545
:vaccination_record,
546546
patient:,
547-
performed_ods_code: organisation.ods_code
547+
performed_ods_code: organisation.ods_code,
548+
programme: create(:programme, :hpv)
548549
)
549550
end
550551

0 commit comments

Comments
 (0)