fix(api-entreprise): Context is not defined in jobs
This commit is contained in:
parent
06d81dcfaf
commit
d161589e2f
2 changed files with 3 additions and 2 deletions
|
@ -163,7 +163,7 @@ class APIEntreprise::API
|
|||
|
||||
def base_params(siret_or_siren)
|
||||
{
|
||||
context: Current.application_name,
|
||||
context: APPLICATION_NAME,
|
||||
recipient: recipient_for(siret_or_siren),
|
||||
non_diffusables: true
|
||||
}
|
||||
|
|
|
@ -120,7 +120,8 @@ describe APIEntreprise::API do
|
|||
describe '.etablissement' do
|
||||
subject { described_class.new(procedure_id).etablissement(siret) }
|
||||
before do
|
||||
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v3\/insee\/sirene\/etablissements\/#{siret}?.*non_diffusables=true/)
|
||||
stub_request(:get, "https://entreprise.api.gouv.fr/v3/insee/sirene/etablissements/#{siret}")
|
||||
.with(query: { "non_diffusables" => "true", "context" => APPLICATION_NAME, "object" => "procedure_id: #{procedure_id}", "recipient" => ENV.fetch("API_ENTREPRISE_DEFAULT_SIRET") })
|
||||
.to_return(status: status, body: body)
|
||||
allow_any_instance_of(APIEntrepriseToken).to receive(:expired?).and_return(false)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue