diff --git a/db/schema.rb b/db/schema.rb index e6f2de905..9e263472c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -303,6 +303,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_01_30_084707) do t.integer "scharge_value_check" t.integer "pscharge_value_check" t.integer "duplicate_set_id" + t.integer "accessible_register" t.integer "nationality_all" t.integer "nationality_all_group" t.index ["bulk_upload_id"], name: "index_lettings_logs_on_bulk_upload_id" diff --git a/spec/helpers/filters_helper_spec.rb b/spec/helpers/filters_helper_spec.rb index f60cc483e..a43d6d318 100644 --- a/spec/helpers/filters_helper_spec.rb +++ b/spec/helpers/filters_helper_spec.rb @@ -1,4 +1,6 @@ require "rails_helper" +require "timecop" +include CollectionTimeHelper RSpec.describe FiltersHelper do describe "#filter_selected?" do @@ -240,12 +242,37 @@ RSpec.describe FiltersHelper do end describe "#collection_year_options" do - it "includes 2023/2024 option" do - expect(collection_year_options).to eq( - { - "2021": "2021/22", "2022": "2022/23", "2023": "2023/24" - }, - ) + context "with 23/24 as the current collection year" do + around do |example| + Timecop.freeze(Time.zone.local(2023, 5, 1)) do + example.run + end + Timecop.return + end + it "has the correct options" do + expect(collection_year_options).to eq( + { + "2023" => "2023/24", "2022" => "2022/23", "2021" => "2021/22" + }, + ) + end + end + + context "with 24/25 as the current collection year" do + around do |example| + Timecop.freeze(Time.zone.local(2024, 5, 1)) do + example.run + end + Timecop.return + end + + it "has the correct options" do + expect(collection_year_options).to eq( + { + "2024" => "2024/25", "2023" => "2023/24", "2022" => "2022/23" + }, + ) + end end end