File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,10 +32,7 @@ class Patient::ConsentStatus < ApplicationRecord
3232
3333 scope :has_vaccine_method ,
3434 -> ( vaccine_method ) do
35- where (
36- "vaccine_methods @> ARRAY[?]::integer[]" ,
37- vaccine_methods . fetch ( vaccine_method )
38- )
35+ where ( "vaccine_methods[1] = ?" , vaccine_methods . fetch ( vaccine_method ) )
3936 end
4037
4138 enum :status ,
Original file line number Diff line number Diff line change 390390 vaccine_methods : %w[ nasal injection ]
391391 )
392392
393- create (
394- :patient_session ,
395- :consent_given_triage_not_needed ,
396- programmes : [ programme ]
393+ _injection_only_patient =
394+ create (
395+ :patient_session ,
396+ :consent_given_triage_not_needed ,
397+ programmes : [ programme ]
398+ )
399+
400+ injection_primary_patient =
401+ create (
402+ :patient_session ,
403+ :consent_given_triage_not_needed ,
404+ programmes : [ programme ]
405+ )
406+
407+ injection_primary_patient . patient . consent_statuses . first . update! (
408+ vaccine_methods : %w[ injection nasal ]
397409 )
398410
399411 expect ( form . apply ( scope ) ) . to contain_exactly ( nasal_patient_session )
You can’t perform that action at this time.
0 commit comments