Skip to content

Commit

Permalink
Update specs for TDA advice on course page
Browse files Browse the repository at this point in the history
  • Loading branch information
inulty-dfe committed Jan 30, 2025
1 parent 5d54b82 commit fd49fbc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
29 changes: 15 additions & 14 deletions spec/features/find/course/undergraduate/viewing_a_course_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,16 @@
scenario 'user visits get into teaching advice page' do
given_there_is_a_findable_undergraduate_course
when_i_visit_the_course_page
and_i_click_to_contact_get_into_teaching
then_i_see_the_tda_advice_callout
and_i_do_not_see_the_support_and_advice_callout
when_i_click_to_contact_get_into_teaching
then_i_am_redirected_to_the_git_help_and_support_page
end

def given_there_is_a_findable_undergraduate_course
user = create(:user, providers: [build(:provider, provider_type: 'lead_school', sites: [build(:site), build(:site)], study_sites: [build(:site, :study_site), build(:site, :study_site)])])
provider = user.providers.first
create(:provider, :accredited_provider, provider_code: '1BK')
accredited_provider = create(:provider, :accredited_provider, provider_code: '1BJ')
provider.accrediting_provider_enrichments = []
provider.accrediting_provider_enrichments << AccreditingProviderEnrichment.new(
{
UcasProviderCode: accredited_provider.provider_code,
Description: 'description'
}
)
@course = create(:course, :published_teacher_degree_apprenticeship, :secondary, provider:, name: 'Biology', subjects: [find_or_create(:secondary_subject, :biology)])
end

Expand All @@ -42,15 +36,22 @@ def when_i_visit_the_course_page
)
end

def and_i_click_to_contact_get_into_teaching
expect(page).to have_content('Support and advice')
expect(page).to have_content('You can contact Get Into Teaching for free support')
click_link_or_button('contact Get Into Teaching')
def then_i_see_the_tda_advice_callout
expect(find_course_show_page.course_tda_advice).to have_css(:h2, text: 'Teacher degree apprenticeship')
expect(find_course_show_page.course_tda_advice).to have_content('On a teacher degree apprenticeship you’ll work in a school and earn a salary while getting a bachelor’s degree and qualified teacher status (QTS).')
end

def and_i_do_not_see_the_support_and_advice_callout
expect(page).to have_no_css(:h2, text: 'Support and advice')
end

def when_i_click_to_contact_get_into_teaching
click_link_or_button('Find out more about teacher degree apprenticeships.')
end

def then_i_am_redirected_to_the_git_help_and_support_page
expect(page.current_url).to eq(
'https://getintoteaching.education.gov.uk/help-and-support'
'https://getintoteaching.education.gov.uk/train-to-be-a-teacher/teacher-degree-apprenticeships'
)
end
end
2 changes: 2 additions & 0 deletions spec/support/page_objects/find/course_show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class CourseShow < PageObjects::Base
element :about_accrediting_provider, '[data-qa=course__about_accrediting_provider]'
element :train_with_disability, '[data-qa=course__train_with_disabilities]'
element :course_advice, '#section-advice'
element :course_tda_advice, '#section-tda-advice'
element :course_support_and_advice, '#section-support-and-advice'
element :course_apply, '#section-apply'
element :apply_link, 'a[data-qa=course__apply_link]'
element :back_link, '[data-qa=page-back]'
Expand Down

0 comments on commit fd49fbc

Please sign in to comment.