Skip to content

Commit

Permalink
Ajout d'un test unitaire
Browse files Browse the repository at this point in the history
  • Loading branch information
tnicolas1 committed Oct 25, 2024
1 parent 3cabf93 commit 20900b8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/jobs/sync/student_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
%i[
birthdate
address_line1
address_line2
address_postal_code
address_city_insee_code
address_country_code
Expand Down Expand Up @@ -53,6 +54,21 @@
end
end

context "when the addresses informations change and have a payment request rejected" do
let(:payment_request) { create(:asp_payment_request, :rejected, reason: "L'adresse ne correspond pas.") }
let(:pfmp) { payment_request.pfmp }

before do
#student.update!(address_line1: Faker::Address.street_name) # TODO: Ne devrait pas passer sans cette ligne
student.current_schooling.pfmps << pfmp
described_class.perform_now(student.current_schooling)
end

it "creates a new payment request" do
expect(pfmp.latest_payment_request).not_to eq(payment_request)
end
end

context "when the API responds with a 404" do
before do
WebMock
Expand Down

0 comments on commit 20900b8

Please sign in to comment.