Skip to content

Commit

Permalink
Add publish specs to all tda feature tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-stefano authored and avinhurry committed May 21, 2024
1 parent 343fb27 commit d5a4362
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions spec/features/publish/courses/new_tda_course_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
when_i_click_on_the_course_description_tab
then_i_do_not_see_the_degree_requirements_row
and_i_do_not_see_the_change_link_for_course_length

given_i_fill_in_all_other_fields_for_the_course
when_i_publish_the_course
then_the_course_is_published
end

scenario 'creating a degree awarding course from scitt provider' do
Expand Down Expand Up @@ -78,6 +82,10 @@
when_i_click_on_the_course_description_tab
then_i_do_not_see_the_degree_requirements_row
and_i_do_not_see_the_change_link_for_course_length

given_i_fill_in_all_other_fields_for_the_course
when_i_publish_the_course
then_the_course_is_published
end

scenario 'when choosing primary course' do
Expand Down Expand Up @@ -113,6 +121,10 @@
when_i_click_on_the_course_description_tab
then_i_do_not_see_the_degree_requirements_row
and_i_do_not_see_the_change_link_for_course_length

given_i_fill_in_all_other_fields_for_the_course
when_i_publish_the_course
then_the_course_is_published
end

scenario 'do not show teacher degree apprenticeship for further education' do
Expand Down Expand Up @@ -370,6 +382,50 @@ def then_i_do_not_see_the_degree_requirements_row
expect(publish_provider_courses_show_page).not_to have_degree
end

def given_i_fill_in_all_other_fields_for_the_course
and_i_add_course_details
and_i_add_salary_information
and_i_add_gcse_requirements
end

def and_i_add_course_details
publish_provider_courses_show_page.about_course.find_link(
text: 'Change details about this course'
).click
publish_course_information_edit_page.about_course.set('Details about the course')
publish_course_information_edit_page.interview_process.set('Interview process details')
publish_course_information_edit_page.school_placements.set('School placements information')
publish_course_information_edit_page.submit.click
end

def and_i_add_salary_information
publish_provider_courses_show_page.salary_details.find_link(text: 'Change salary').click
publish_course_salary_edit_page.salary_details.set('Some salary details')
publish_course_salary_edit_page.submit.click
end

def and_i_add_gcse_requirements
publish_provider_courses_show_page.gcse.find_link(
text: 'Enter GCSE and equivalency test requirements'
).click
publish_courses_gcse_requirements_page.pending_gcse_yes_radio.click
publish_courses_gcse_requirements_page.gcse_equivalency_yes_radio.click
publish_courses_gcse_requirements_page.english_equivalency.check
publish_courses_gcse_requirements_page.maths_equivalency.check
publish_courses_gcse_requirements_page.additional_requirements.set('Some Proficiency')
publish_courses_gcse_requirements_page.save.click
end

def when_i_publish_the_course
publish_provider_courses_show_page.course_button_panel.publish_button.click
end

def then_the_course_is_published
expect(publish_provider_courses_show_page.errors.map(&:text)).to eq([])
expect(page).to have_content('Your course has been published.')
expect(course.content_status).to be :published
end

def provider
@user.providers.first
end
Expand Down

0 comments on commit d5a4362

Please sign in to comment.