|
1310 | 1310 | end |
1311 | 1311 | end |
1312 | 1312 |
|
1313 | | - context "when the old patient has a school move to a school" do |
| 1313 | + context "when the old patient has school moves" do |
1314 | 1314 | let(:team) { create(:team) } |
1315 | 1315 | let(:school) { create(:school, team:) } |
1316 | 1316 |
|
|
1329 | 1329 | ) |
1330 | 1330 | end |
1331 | 1331 | end |
1332 | | - |
1333 | | - context "when the old patient has a school move to an unknown school" do |
1334 | | - let(:team) { create(:team) } |
1335 | | - |
1336 | | - before do |
1337 | | - create(:school_move, :to_unknown_school, patient: old_patient, team:) |
1338 | | - end |
1339 | | - |
1340 | | - it "adds any school moves from the old patient" do |
1341 | | - expect(new_patient.school_moves.size).to eq(1) |
1342 | | - expect(new_patient.school_moves.first.home_educated).to be(false) |
1343 | | - end |
1344 | | - |
1345 | | - it "adds the new patient to the teams" do |
1346 | | - expect(new_patient.patient_teams.size).to eq(1) |
1347 | | - expect(new_patient.patient_teams.first.team_id).to eq(team.id) |
1348 | | - expect(new_patient.patient_teams.first.sources).to contain_exactly( |
1349 | | - "school_move_team" |
1350 | | - ) |
1351 | | - end |
1352 | | - end |
1353 | | - |
1354 | | - context "when the old patient has a school move to home-schooled" do |
1355 | | - let(:team) { create(:team) } |
1356 | | - |
1357 | | - before do |
1358 | | - create(:school_move, :to_home_educated, patient: old_patient, team:) |
1359 | | - end |
1360 | | - |
1361 | | - it "adds any school moves from the old patient" do |
1362 | | - expect(new_patient.school_moves.size).to eq(1) |
1363 | | - expect(new_patient.school_moves.first.home_educated).to be(true) |
1364 | | - end |
1365 | | - |
1366 | | - it "adds the new patient to the teams" do |
1367 | | - expect(new_patient.patient_teams.size).to eq(1) |
1368 | | - expect(new_patient.patient_teams.first.team_id).to eq(team.id) |
1369 | | - expect(new_patient.patient_teams.first.sources).to contain_exactly( |
1370 | | - "school_move_team" |
1371 | | - ) |
1372 | | - end |
1373 | | - end |
1374 | 1332 | end |
1375 | 1333 |
|
1376 | 1334 | describe "#destroy_childless_parents" do |
|
0 commit comments