Skip to content

Commit

Permalink
Allow course creation for Summer 2023 (#2443)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dantemss authored Oct 6, 2022
1 parent 529e621 commit fcc1c60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/term_year.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 8 additions & 2 deletions spec/lib/term_year_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit fcc1c60

Please sign in to comment.