Ajoute les dossiers déposés dans les statistiques Datagouv
This commit is contained in:
parent
ac94a49462
commit
4d6ff768c4
2 changed files with 38 additions and 0 deletions
19
spec/jobs/cron/datagouv/file_depose_by_month_job_spec.rb
Normal file
19
spec/jobs/cron/datagouv/file_depose_by_month_job_spec.rb
Normal file
|
@ -0,0 +1,19 @@
|
|||
RSpec.describe Cron::Datagouv::FileDeposeByMonthJob, type: :job do
|
||||
let!(:dossier) { create(:dossier, created_at: 1.month.ago) }
|
||||
let(:status) { 200 }
|
||||
let(:body) { "ok" }
|
||||
let(:stub) { stub_request(:post, /https:\/\/www.data.gouv.fr\/api\/.*\/upload\//) }
|
||||
|
||||
describe 'perform' do
|
||||
before do
|
||||
stub
|
||||
end
|
||||
|
||||
subject { Cron::Datagouv::FileByMonthJob.perform_now }
|
||||
|
||||
it 'send POST request to datagouv' do
|
||||
subject
|
||||
expect(stub).to have_been_requested
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue