File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ def to_patient
39
39
end
40
40
41
41
def to_school_move ( patient )
42
+ return if patient . deceased?
43
+
42
44
if patient . new_record? || patient . school != school ||
43
45
patient . home_educated != home_educated || patient . not_in_team?
44
46
school_move =
Original file line number Diff line number Diff line change 131
131
end
132
132
end
133
133
134
+ describe "#to_school_move" do
135
+ subject { class_import_row . to_school_move ( patient ) }
136
+
137
+ let ( :data ) { valid_data }
138
+
139
+ let ( :patient ) { class_import_row . to_patient }
140
+
141
+ context "without a date of death" do
142
+ it { should_not be_nil }
143
+ end
144
+
145
+ context "with a date of death" do
146
+ before { patient . update! ( date_of_death : today ) }
147
+
148
+ it { should be_nil }
149
+ end
150
+ end
151
+
134
152
describe "#to_parents" do
135
153
subject ( :parents ) { class_import_row . to_parents }
136
154
Original file line number Diff line number Diff line change 561
561
562
562
it { should_not be_nil }
563
563
564
+ context "with a date of death" do
565
+ before { patient . update! ( date_of_death : today ) }
566
+
567
+ it { should be_nil }
568
+ end
569
+
564
570
describe "#school" do
565
571
subject ( :school ) { school_move . school }
566
572
You can’t perform that action at this time.
0 commit comments