From 8079408075afa1d7036e6b325a7291bdb7b26793 Mon Sep 17 00:00:00 2001 From: Tomas D'Stefano Date: Thu, 10 Oct 2024 17:08:29 +0100 Subject: [PATCH] Show the right data when undergraduate courses --- app/helpers/qualification_value_helper.rb | 6 +++++- ...plication_course_summary_component_spec.rb | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/app/helpers/qualification_value_helper.rb b/app/helpers/qualification_value_helper.rb index ef76daef1a9..7ff3258feaa 100644 --- a/app/helpers/qualification_value_helper.rb +++ b/app/helpers/qualification_value_helper.rb @@ -2,6 +2,10 @@ module QualificationValueHelper def qualification_text(course_option) return if course_option.course.qualifications.nil? - course_option.course.qualifications.map(&:upcase).join(' with ') + if course_option.course.undergraduate? + course_option.course.description + else + course_option.course.qualifications.map(&:upcase).join(' with ') + end end end diff --git a/spec/components/provider_interface/application_course_summary_component_spec.rb b/spec/components/provider_interface/application_course_summary_component_spec.rb index 4c7d3ba3f44..0e07032b477 100644 --- a/spec/components/provider_interface/application_course_summary_component_spec.rb +++ b/spec/components/provider_interface/application_course_summary_component_spec.rb @@ -133,4 +133,23 @@ def row_text_selector(row_name, render) expect(render_text).to include('Funding type') expect(render_text).to include('Fee') end + + context 'when undergraduate application' do + let(:course) do + build( + :course, + :teacher_degree_apprenticeship, + name: 'Geograpghy', + code: 'H234', + provider:, + ) + end + + it 'renders the undergraduate course qualification' do + render_text = row_text_selector(:qualification, render) + + expect(render_text).to include('Qualification') + expect(render_text).to include('Teacher degree apprenticeship with QTS') + end + end end