Skip to content

Commit

Permalink
🥗 Tobias: Issuing Payouts doesn't create additional payouts per b…
Browse files Browse the repository at this point in the history
…eneficiary

I thought that this would actually be a problem, but apparently it's
not! Hooray for tests!
  • Loading branch information
zspencer committed Jan 29, 2024
1 parent cd3d2d8 commit 77ecd09
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/tobias/payout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,17 @@
expect(beneficiary.payments).to exist(amount_cents: 15_00)
end
end

context "when running twice" do
it "does not issue multiple payouts" do
payout = create(:tobias_payout, amount_cents: 100_00)

create_list(:tobias_beneficiary, 2, trust: payout.trust)

payout.issue

expect { payout.issue }.not_to(change(payout.payments, :count))
end
end
end
end

0 comments on commit 77ecd09

Please sign in to comment.