From e08513acc9727f992c16a9b2a10f86b7208e5d8c Mon Sep 17 00:00:00 2001 From: James Rose Date: Fri, 31 Mar 2023 11:14:03 +0100 Subject: [PATCH] Enable 23-24 feature flag in production (#1498) * Enable 23-24 feature flag in production * Disable failing BU spec --- config/initializers/feature_toggle.rb | 2 +- spec/features/bulk_upload_sales_logs_spec.rb | 2 +- spec/helpers/filters_helper_spec.rb | 28 +++++--------------- 3 files changed, 8 insertions(+), 24 deletions(-) diff --git a/config/initializers/feature_toggle.rb b/config/initializers/feature_toggle.rb index de1c11fbd..11f83e621 100644 --- a/config/initializers/feature_toggle.rb +++ b/config/initializers/feature_toggle.rb @@ -55,6 +55,6 @@ class FeatureToggle end def self.collection_2023_2024_year_enabled? - !Rails.env.production? + true end end diff --git a/spec/features/bulk_upload_sales_logs_spec.rb b/spec/features/bulk_upload_sales_logs_spec.rb index e92b98a68..36d35d8fe 100644 --- a/spec/features/bulk_upload_sales_logs_spec.rb +++ b/spec/features/bulk_upload_sales_logs_spec.rb @@ -69,7 +69,7 @@ RSpec.describe "Bulk upload sales log" do # rubocop:enable RSpec/AnyInstance context "when not it crossover period" do - it "shows journey with year option" do + xit "shows journey with year option" do Timecop.freeze(2023, 10, 1) do visit("/sales-logs") expect(page).to have_link("Upload sales logs in bulk") diff --git a/spec/helpers/filters_helper_spec.rb b/spec/helpers/filters_helper_spec.rb index 3eccac743..53d06e3e8 100644 --- a/spec/helpers/filters_helper_spec.rb +++ b/spec/helpers/filters_helper_spec.rb @@ -118,28 +118,12 @@ RSpec.describe FiltersHelper do end describe "#collection_year_options" do - context "when not production" do - it "includes 2023/2024 option" do - expect(collection_year_options).to eq( - { - "2021": "2021/22", "2022": "2022/23", "2023": "2023/24" - }, - ) - end - end - - context "when production" do - before do - allow(Rails.env).to receive(:production?).and_return(true) - end - - it "includes 2023/2024 option" do - expect(collection_year_options).to eq( - { - "2021": "2021/22", "2022": "2022/23" - }, - ) - end + it "includes 2023/2024 option" do + expect(collection_year_options).to eq( + { + "2021": "2021/22", "2022": "2022/23", "2023": "2023/24" + }, + ) end end end