Skip to content

Commit

Permalink
🥗 Tobais: Spec for Issuing a Payout
Browse files Browse the repository at this point in the history
- #11
- I'm "presuming" that a single #9
  may wind up managing multiplehttps://github.com//issues/4
- This sketches out the pathway for creating a #8
  via the Web
  • Loading branch information
zspencer committed Mar 25, 2024
1 parent b354b6b commit b1b3055
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/tobias/issuing_payouts_system_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require "rails_helper"
require_relative "factories/trust_factory"
require_relative "factories/beneficiary_factory"

# @see https://github.com/zinc-collective/tobias/issues/11
RSpec.describe "Tobias: Issuing a Payout", type: :system do
scenario "Issuing a `Payout` to multiple `Beneficiaries`" do # rubocop:disable RSpec/Capybara/FeatureMethods,RSpec/ExampleLength
trust = create(:tobias_trust)
beneficiaries = create_list(:tobias_beneficiary, 10, trust:)
visit(polymorphic_path(trust.location))
click_link("New Payout")
fill_in("Amount", with: 250_00)

click_button("Create Payout")

click_button("Issue Payout")

expect(page).to have_content("$25.00 Payments Issued to 10 Beneficiaries")
beneficiaries.each do |beneficiary|
expect(page).to have_content("#{beneficiary.name} $25.00 Pending")
end
end
end

0 comments on commit b1b3055

Please sign in to comment.