Skip to content

Commit

Permalink
Fix tests which fail when current cycle closes
Browse files Browse the repository at this point in the history
These tests make more sense to fix when the time comes because:

- The next recruitment cycle will become the current recruitment cycle

- We should be able to remove the TDA feature flag and recruitment cycle check at this point

This branch will act as a SPIKE.
  • Loading branch information
avinhurry committed Jul 17, 2024
1 parent 3ab34f4 commit 02fda5c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cookies:
name: _consented_to_analytics_cookies
expire_after_days: 182

current_recruitment_cycle_year: 2024
current_recruitment_cycle_year: 2025
next_cycle_open_date: 2024-10-1

govuk_notify:
Expand Down
3 changes: 1 addition & 2 deletions spec/controllers/publish/courses/outcome_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
require 'rails_helper'

RSpec.describe Publish::Courses::OutcomeController do
let(:recruitment_cycle) { create(:recruitment_cycle, year: 2025) }
let(:user) { create(:user, providers: [build(:provider, recruitment_cycle:)]) }
let(:user) { create(:user, providers: [build(:provider)]) }
let(:provider) { user.providers.first }

before do
Expand Down
17 changes: 4 additions & 13 deletions spec/features/publish/courses/editing_course_outcome_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

context 'TDA course' do
scenario 'changing the outcome from non TDA to TDA' do
given_i_am_authenticated_as_a_provider_user_in_the_next_cycle
given_i_am_authenticated_as_a_provider_user
and_the_tda_feature_flag_is_active
and_there_is_a_qts_course_i_want_to_edit
when_i_visit_the_course_outcome_page_in_the_next_cycle
Expand All @@ -45,7 +45,7 @@

context 'fee course' do
scenario 'changing the outcome from TDA to non TDA' do
given_i_am_authenticated_as_a_provider_user_in_the_next_cycle
given_i_am_authenticated_as_a_provider_user
and_the_tda_feature_flag_is_active
and_there_is_a_tda_course_i_want_to_edit
when_i_visit_the_course_outcome_page_in_the_next_cycle
Expand All @@ -72,7 +72,7 @@

context 'salaried course' do
scenario 'changing the outcome from TDA to non TDA' do
given_i_am_authenticated_as_a_provider_user_in_the_next_cycle
given_i_am_authenticated_as_a_provider_user
and_the_tda_feature_flag_is_active
and_there_is_a_tda_course_i_want_to_edit
when_i_visit_the_course_outcome_page_in_the_next_cycle
Expand All @@ -88,15 +88,6 @@
end
end

def given_i_am_authenticated_as_a_provider_user_in_the_next_cycle
next_cycle_providers = [build(:provider, :next_recruitment_cycle, :accredited_provider,
courses: [create(:course, :with_accrediting_provider)],
sites: [build(:site), build(:site)],
study_sites: [build(:site, :study_site)])]
@next_cycle_user = create(:user, providers: next_cycle_providers)
given_i_am_authenticated(user: @next_cycle_user)
end

def given_i_am_authenticated_as_a_provider_user
given_i_am_authenticated(user: create(:user, :with_provider))
end
Expand Down Expand Up @@ -148,7 +139,7 @@ def and_the_course_outcome_is_updated
end

def then_i_am_shown_the_correct_qts_options
expect(publish_courses_outcome_edit_page.qualification_names).to contain_exactly('QTS', 'QTS with PGCE', 'PGDE with QTS')
expect(publish_courses_outcome_edit_page.qualification_names).to contain_exactly('QTS', 'QTS with PGCE', 'PGDE with QTS', 'Teacher degree apprenticeship (TDA) with QTS')
end

def then_i_am_shown_the_correct_non_qts_options
Expand Down

0 comments on commit 02fda5c

Please sign in to comment.