Skip to content

Commit

Permalink
Filter out api client files from coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jbfeldis committed Nov 27, 2024
1 parent 006fcff commit 59020fe
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/clients/formulaire_qf_api_client.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# :nocov:
class FormulaireQFAPIClient
def create_collectivity(organization:, editor_id: nil)
params = {
Expand Down
1 change: 1 addition & 0 deletions app/clients/hubee_api_authentication.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# :nocov:
class HubEEAPIAuthentication < AbstractHubEEAPIClient
def access_token
http_connection.post(
Expand Down
1 change: 1 addition & 0 deletions app/clients/hubee_api_client.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# :nocov:
class HubEEAPIClient < AbstractHubEEAPIClient # rubocop:disable Metrics/ClassLength
class NotFound < StandardError; end
class AlreadyExists < StandardError; end
Expand Down
22 changes: 22 additions & 0 deletions spec/jobs/create_formulaire_qf_resources_job_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require 'rails_helper'

RSpec.describe CreateFormulaireQFResourcesJob do
describe '#perform' do
subject do
described_class.perform_now(authorization_request_id)
end

let(:authorization_request) { create(:authorization_request, :with_demandeur, :with_contact_technique) }
let(:authorization_request_id) { authorization_request.id }

before do
allow(DatapassWebhook::CreateFormulaireQFResources).to receive(:call).with(authorization_request:)
end

it 'creates FormulaireQF resources' do
subject

expect(DatapassWebhook::CreateFormulaireQFResources).to have_received(:call).with(authorization_request:)
end
end
end

0 comments on commit 59020fe

Please sign in to comment.