Skip to content

Commit

Permalink
wip -> merge test files
Browse files Browse the repository at this point in the history
  • Loading branch information
ac-dylan committed Jul 18, 2024
1 parent cef2a29 commit 6f84815
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 38 deletions.
18 changes: 18 additions & 0 deletions spec/requests/schoolings_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
let(:student) { schooling.student }
let(:user) { create(:user, :director, :with_selected_establishment, establishment: student.classe.establishment) }

let(:schooling) { create(:schooling, :with_attributive_decision) }
let(:payment_request) { create(:asp_payment_request, :incomplete_for_missing_abrogation_da) }

before do
sign_in(user)
schooling.pfmps = [payment_request.pfmp]
schooling.save!
Timecop.safe_mode = false
Timecop.freeze(Date.new(2024, 6, 21))
end
Expand All @@ -25,4 +30,17 @@
params: { confirmed_director: "1" }
end
end

describe "retry_eligibile_payment_requests" do
before do
schooling.update!(end_date: Date.parse("2024-06-20"))
end

it "retries eligible payment requests" do
delete abrogate_decision_school_year_class_schooling_path(schooling.classe.school_year,
class_id: schooling.classe.id, id: schooling.id),
params: { confirmed_director: "1" }
expect(payment_request.last_transition.metadata).not_to include(I18n.t("activerecord.errors.models.asp/payment_request.attributes.ready_state_validation.needs_abrogated_attributive_decision"))
end
end
end
38 changes: 0 additions & 38 deletions spec/requests/schoolings_controller_test_spec.rb

This file was deleted.

0 comments on commit 6f84815

Please sign in to comment.