|
|
@ -245,6 +245,11 @@ RSpec.describe FiltersHelper do |
|
|
|
allow(Time).to receive(:now).and_return(Time.zone.local(2023, 5, 1)) |
|
|
|
allow(Time).to receive(:now).and_return(Time.zone.local(2023, 5, 1)) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "and in crossover period" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
allow(FormHandler.instance).to receive(:in_crossover_period?).and_return(true) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "has the correct options" do |
|
|
|
it "has the correct options" do |
|
|
|
expect(collection_year_options).to eq( |
|
|
|
expect(collection_year_options).to eq( |
|
|
|
{ |
|
|
|
{ |
|
|
@ -254,6 +259,21 @@ RSpec.describe FiltersHelper do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "and not in crossover period" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
allow(FormHandler.instance).to receive(:in_crossover_period?).and_return(false) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "has the correct options" do |
|
|
|
|
|
|
|
expect(collection_year_options).to eq( |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"2023" => "2023/24", "2022" => "2022/23" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "with 24/25 as the current collection year" do |
|
|
|
context "with 24/25 as the current collection year" do |
|
|
|
before do |
|
|
|
before do |
|
|
|
allow(Time).to receive(:now).and_return(Time.zone.local(2024, 5, 1)) |
|
|
|
allow(Time).to receive(:now).and_return(Time.zone.local(2024, 5, 1)) |
|
|
|