fetch effectifs mensuels for may month

This commit is contained in:
Christophe Robillard 2020-06-24 10:07:47 +02:00
parent 2b2960f7a1
commit 954d41ce4e
2 changed files with 3 additions and 3 deletions

View file

@ -1,8 +1,8 @@
class ApiEntreprise::EffectifsJob < ApiEntreprise::Job
def perform(etablissement_id, procedure_id)
etablissement = Etablissement.find(etablissement_id)
# april 2020 is at the moment the most actual info for effectifs endpoint
etablissement_params = ApiEntreprise::EffectifsAdapter.new(etablissement.siret, procedure_id, "2020", "04").to_params
# may 2020 is at the moment the most actual info for effectifs endpoint
etablissement_params = ApiEntreprise::EffectifsAdapter.new(etablissement.siret, procedure_id, "2020", "05").to_params
etablissement.update!(etablissement_params)
end

View file

@ -6,7 +6,7 @@ RSpec.describe ApiEntreprise::EffectifsJob, type: :job do
let(:procedure_id) { procedure.id }
let(:now) { Time.zone.local(2020, 3, 12) }
let(:annee) { "2020" }
let(:mois) { "04" }
let(:mois) { "05" }
let(:body) { File.read('spec/fixtures/files/api_entreprise/effectifs.json') }
let(:status) { 200 }