File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ module Pbs::Event::Application
1111
1212 has_many :approvals , dependent : :destroy
1313
14- after_create :initialize_approval
14+ after_commit :initialize_approval , on : :create
1515 end
1616
1717 def next_open_approval
Original file line number Diff line number Diff line change 6363 expect ( participation . approvers ) . to have ( 2 ) . items
6464 expect ( participation . approvers ) . to include ( people ( :bulei ) , people ( :al_schekka ) )
6565 end
66+
67+ it "enqueues approval request job with participation" do
68+ event . update! ( requires_approval_abteilung : true )
69+ participation = Fabricate ( :pbs_participation ,
70+ event : event ,
71+ application : Event ::Application . new ( priority_1 : event ) , participant : people ( :child ) )
72+ job = Delayed ::Job . last . payload_object
73+ expect ( job ) . to be_a ( Event ::ApprovalRequestJob )
74+ expect ( job . parameters [ :participation_id ] ) . to eq participation . id
75+ end
6676 end
6777
6878 context "#j_s_data_sharing_accepted" do
You can’t perform that action at this time.
0 commit comments