Skip to content

Commit

Permalink
Merge pull request #4515 from DFE-Digital/update-leftover-instances-o…
Browse files Browse the repository at this point in the history
…f-course-type

Update `course_type` to `degree_type`
  • Loading branch information
avinhurry authored Sep 11, 2024
2 parents 01d13e0 + 02d1187 commit ad4dd63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/models/course.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions spec/models/course_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ad4dd63

Please sign in to comment.