diff --git a/spec/tobias/payout_spec.rb b/spec/tobias/payout_spec.rb index afcbc3ee1..53556bfe7 100644 --- a/spec/tobias/payout_spec.rb +++ b/spec/tobias/payout_spec.rb @@ -15,5 +15,19 @@ expect(beneficiary.payments).to exist(amount_cents: 15_00) end end + + context "when the Payout#amount does not divide evenly" do + it "rounds down so that it can" do + payout = create(:tobias_payout, amount_cents: 3_33) + + beneficiaries = create_list(:tobias_beneficiary, 2, trust: payout.trust) + + payout.issue + + beneficiaries.each do |beneficiary| + expect(beneficiary.payments).to exist(amount_cents: 1_66) + end + end + end end end