Add support for FASP data sharing (#34415)
This commit is contained in:
parent
3ea1f074ab
commit
a5a2c6dc7e
38 changed files with 1140 additions and 1 deletions
32
spec/workers/fasp/backfill_worker_spec.rb
Normal file
32
spec/workers/fasp/backfill_worker_spec.rb
Normal file
|
@ -0,0 +1,32 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Fasp::BackfillWorker do
|
||||
include ProviderRequestHelper
|
||||
|
||||
let(:backfill_request) { Fabricate(:fasp_backfill_request) }
|
||||
let(:provider) { backfill_request.fasp_provider }
|
||||
let(:status) { Fabricate(:status) }
|
||||
let!(:stubbed_request) do
|
||||
stub_provider_request(provider,
|
||||
method: :post,
|
||||
path: '/data_sharing/v0/announcements',
|
||||
response_body: {
|
||||
source: {
|
||||
backfillRequest: {
|
||||
id: backfill_request.id.to_s,
|
||||
},
|
||||
},
|
||||
category: 'content',
|
||||
objectUris: [status.uri],
|
||||
moreObjectsAvailable: false,
|
||||
})
|
||||
end
|
||||
|
||||
it 'sends status uri to provider that requested backfill' do
|
||||
described_class.new.perform(backfill_request.id)
|
||||
|
||||
expect(stubbed_request).to have_been_made
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue