Stop using Flipflop as switch for weekly_overview
This commit is contained in:
parent
25db21467d
commit
6cfad01d12
4 changed files with 7 additions and 5 deletions
|
@ -3,7 +3,7 @@ class WeeklyOverviewJob < ApplicationJob
|
||||||
|
|
||||||
def perform(*args)
|
def perform(*args)
|
||||||
# Feature flipped to avoid mails in staging due to unprocessed dossier
|
# Feature flipped to avoid mails in staging due to unprocessed dossier
|
||||||
if Flipflop.weekly_overview?
|
if Rails.application.config.ds_weekly_overview
|
||||||
Gestionnaire.all
|
Gestionnaire.all
|
||||||
.map { |gestionnaire| [gestionnaire, gestionnaire.last_week_overview] }
|
.map { |gestionnaire| [gestionnaire, gestionnaire.last_week_overview] }
|
||||||
.reject { |_, overview| overview.nil? }
|
.reject { |_, overview| overview.nil? }
|
||||||
|
|
|
@ -39,5 +39,7 @@ module TPS
|
||||||
# Make main application helpers available in administrate
|
# Make main application helpers available in administrate
|
||||||
Administrate::ApplicationController.helper(TPS::Application.helpers)
|
Administrate::ApplicationController.helper(TPS::Application.helpers)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
config.ds_weekly_overview = ENV['APP_NAME'] == 'tps'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -31,8 +31,6 @@ Flipflop.configure do
|
||||||
group :production do
|
group :production do
|
||||||
feature :insee_api_v3,
|
feature :insee_api_v3,
|
||||||
default: true
|
default: true
|
||||||
feature :weekly_overview,
|
|
||||||
default: ENV['APP_NAME'] == 'tps'
|
|
||||||
feature :pre_maintenance_mode
|
feature :pre_maintenance_mode
|
||||||
feature :maintenance_mode
|
feature :maintenance_mode
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,7 +8,10 @@ RSpec.describe WeeklyOverviewJob, type: :job do
|
||||||
|
|
||||||
context 'if the feature is enabled' do
|
context 'if the feature is enabled' do
|
||||||
before do
|
before do
|
||||||
Flipflop::FeatureSet.current.test!.switch!(:weekly_overview, true)
|
Rails.application.config.ds_weekly_overview = true
|
||||||
|
end
|
||||||
|
after do
|
||||||
|
Rails.application.config.ds_weekly_overview = false
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with one gestionnaire with one overview' do
|
context 'with one gestionnaire with one overview' do
|
||||||
|
@ -35,7 +38,6 @@ RSpec.describe WeeklyOverviewJob, type: :job do
|
||||||
|
|
||||||
context 'if the feature is disabled' do
|
context 'if the feature is disabled' do
|
||||||
before do
|
before do
|
||||||
Flipflop::FeatureSet.current.test!.switch!(:weekly_overview, false)
|
|
||||||
allow(Gestionnaire).to receive(:all)
|
allow(Gestionnaire).to receive(:all)
|
||||||
WeeklyOverviewJob.new.perform
|
WeeklyOverviewJob.new.perform
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue