unschedule export demarches opendata

This commit is contained in:
Christophe Robillard 2022-09-29 18:05:52 +02:00
parent 615c8c370f
commit da0738c661
2 changed files with 7 additions and 4 deletions

View file

@ -1,7 +1,10 @@
class Cron::Datagouv::ExportAndPublishDemarchesPubliquesJob < Cron::CronJob
include DatagouvCronSchedulableConcern
self.schedule_expression = "every month at 3:00"
def self.schedulable?
false
end
def perform(*args)
gzip_filepath = [
'tmp/',

View file

@ -28,13 +28,13 @@ RSpec.describe Cron::Datagouv::ExportAndPublishDemarchesPubliquesJob, type: :job
describe '#schedulable?' do
context "when ENV['OPENDATA_ENABLED'] == 'enabled'" do
it 'is schedulable' do
it 'is not schedulable' do
ENV['OPENDATA_ENABLED'] = 'enabled'
expect(Cron::Datagouv::ExportAndPublishDemarchesPubliquesJob.schedulable?).to be_truthy
expect(Cron::Datagouv::ExportAndPublishDemarchesPubliquesJob.schedulable?).to be_falsy
end
end
context "when ENV['OPENDATA_ENABLED'] != 'enabled'" do
it 'is schedulable' do
it 'is not schedulable' do
ENV['OPENDATA_ENABLED'] = nil
expect(Cron::Datagouv::ExportAndPublishDemarchesPubliquesJob.schedulable?).to be_falsy
end