Skip to content

Commit eb4e22f

Browse files
authored
Merge pull request #5595 from nhsuk/revert-5594-default-consent-disease-types
Revert "Default `disease_types` from programme in `DraftConsent`"
2 parents c614adb + 7e58efe commit eb4e22f

2 files changed

Lines changed: 1 addition & 11 deletions

File tree

app/models/draft_consent.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def write_to!(consent, triage_form:)
327327
consent.parent = parent
328328
consent.submitted_at ||= Time.current
329329
consent.academic_year = academic_year if academic_year.present?
330-
consent.disease_types = disease_types.presence || programme.disease_types
330+
consent.disease_types = disease_types
331331

332332
if triage_allowed? && requires_triage?
333333
triage_form.add_patient_specific_direction =

spec/models/draft_consent_spec.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,6 @@
114114
end
115115
end
116116
end
117-
118-
context "when disease_types is not present" do
119-
it "falls back to the disease types from the programme" do
120-
freeze_time do
121-
expect { write_to }.to change(consent, :disease_types).from(nil).to(
122-
Programme::DISEASE_TYPES[programme.type]
123-
)
124-
end
125-
end
126-
end
127117
end
128118

129119
describe "#reset_unused_attributes" do

0 commit comments

Comments
 (0)