From 02d11879b68b69c528880029b51f803bd979a73e Mon Sep 17 00:00:00 2001 From: Avin Hurry Date: Wed, 11 Sep 2024 15:18:39 +0100 Subject: [PATCH] Change course_type to degree_type course_type is being dropped, degree_type is the replacement --- app/models/course.rb | 2 +- spec/models/course_spec.rb | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index 48ab9ee137..009cd1e14b 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -764,7 +764,7 @@ def funding_type=(funding_type) end def training_route - TRAINING_ROUTE_MAP.fetch([course_type, funding_type], 'unknown_training_route') + TRAINING_ROUTE_MAP.fetch([degree_type, funding_type], 'unknown_training_route') end def ensure_site_statuses_match_study_mode diff --git a/spec/models/course_spec.rb b/spec/models/course_spec.rb index e4dda0368f..27e53fc53b 100644 --- a/spec/models/course_spec.rb +++ b/spec/models/course_spec.rb @@ -3569,27 +3569,27 @@ describe '#training_route' do it 'returns teacher_degree_apprenticeship for undergraduate and apprenticeship' do - course = build(:course, funding: 'apprenticeship', course_type: 'undergraduate') + course = build(:course, funding: 'apprenticeship', degree_type: 'undergraduate') expect(course.training_route).to eq('teacher_degree_apprenticeship') end it 'returns school_direct_salaried for postgraduate and salaried' do - course = build(:course, funding: 'salary', course_type: 'postgraduate') + course = build(:course, funding: 'salary', degree_type: 'postgraduate') expect(course.training_route).to eq('school_direct_salaried') end it 'returns postgraduate_teaching_apprenticeship for postgraduate and apprenticeship' do - course = build(:course, funding: 'apprenticeship', course_type: 'postgraduate') + course = build(:course, funding: 'apprenticeship', degree_type: 'postgraduate') expect(course.training_route).to eq('postgraduate_teacher_apprenticeship') end it 'returns fee_funded_initial_teacher_training for postgraduate and fee' do - course = build(:course, funding: 'fee', course_type: 'postgraduate') + course = build(:course, funding: 'fee', degree_type: 'postgraduate') expect(course.training_route).to eq('fee_funded_initial_teacher_training') end - it 'returns unknown_training_route for unknown course_type and funding_type combination' do - course = build(:course, funding: 'fee', course_type: 'undergraduate') + it 'returns unknown_training_route for unknown degree_type and funding_type combination' do + course = build(:course, funding: 'fee', degree_type: 'undergraduate') expect(course.training_route).to eq('unknown_training_route') end end