From 91df8599f04a8338b44d8a2ad9c9d838395b2398 Mon Sep 17 00:00:00 2001 From: Zee Spencer <50284+zspencer@users.noreply.github.com> Date: Mon, 12 Feb 2024 15:17:58 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=97=20`Tobais`:=20Spec=20for=20Issuing?= =?UTF-8?q?=20a=20`Payout`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - https://github.com/zinc-collective/tobias/issues/11 - I'm "presuming" that a single https://github.com/zinc-collective/tobias/issues/9 may wind up managing multiplehttps://github.com/zinc-collective/tobias/issues/4 - This sketches out the pathway for creating a https://github.com/zinc-collective/tobias/issues/8 via the Web --- spec/tobias/issuing_payouts_system_spec.rb | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 spec/tobias/issuing_payouts_system_spec.rb diff --git a/spec/tobias/issuing_payouts_system_spec.rb b/spec/tobias/issuing_payouts_system_spec.rb new file mode 100644 index 000000000..d5f7dd05e --- /dev/null +++ b/spec/tobias/issuing_payouts_system_spec.rb @@ -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