From fcc1c60b073f68c516fa49eef6d86931aeb3941b Mon Sep 17 00:00:00 2001 From: Dante Soares Date: Thu, 6 Oct 2022 12:26:54 -0500 Subject: [PATCH] Allow course creation for Summer 2023 (#2443) --- lib/term_year.rb | 2 +- spec/lib/term_year_spec.rb | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/term_year.rb b/lib/term_year.rb index dc30a696d..8de8572bf 100644 --- a/lib/term_year.rb +++ b/lib/term_year.rb @@ -29,7 +29,7 @@ const_set 'VISIBLE_TERMS', [:spring, :summer, :fall, :winter] SUNSET_YEAR = 2023 - SUNSET_YEAR_VISIBLE_TERMS = [:spring] + SUNSET_YEAR_VISIBLE_TERMS = [:spring, :summer] attr_reader :starts_at, :ends_at diff --git a/spec/lib/term_year_spec.rb b/spec/lib/term_year_spec.rb index 14378fbd4..9d0f2ff76 100644 --- a/spec/lib/term_year_spec.rb +++ b/spec/lib/term_year_spec.rb @@ -196,7 +196,8 @@ expect(TermYear.visible_term_years(fall_date_time)).to eq [ TermYear.new(:fall, current_year), TermYear.new(:winter, current_year), - TermYear.new(:spring, current_year + 1) + TermYear.new(:spring, current_year + 1), + TermYear.new(:summer, current_year + 1) ] end end @@ -207,13 +208,18 @@ it 'returns the correct visible_term_years' do expect(TermYear.visible_term_years(spring_date_time)).to eq [ TermYear.new(:spring, current_year), + TermYear.new(:summer, current_year) ] expect(TermYear.visible_term_years(spring_summer_date_time)).to eq [ TermYear.new(:spring, current_year), + TermYear.new(:summer, current_year) + ] + + expect(TermYear.visible_term_years(summer_fall_date_time)).to eq [ + TermYear.new(:summer, current_year) ] - expect(TermYear.visible_term_years(summer_fall_date_time)).to eq [] expect(TermYear.visible_term_years(fall_date_time)).to eq [] end end