Non inviare in automatico le istruzioni di bonifico.

IBAN e causale restano da comunicare a mano dall'admin; la richiesta registra solo l'ordine in attesa.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-19 18:40:45 +02:00
co-authored by Cursor
parent 5bcb4170c7
commit a51d5e8da5
2 changed files with 10 additions and 12 deletions
@@ -26,11 +26,11 @@ RSpec.describe Billing::RequestBankTransfer do
)
end
it "crea l'ordine a listino e invia le istruzioni" do
it "crea l'ordine a listino senza inviare le istruzioni" do
expect {
described_class.call(club: club, user: user, plan_slug: "premium_light", interval: "yearly")
}.to change { club.billing_transfer_orders.count }.by(1)
.and change { ActionMailer::Base.deliveries.size }.by(1)
.and change { ActionMailer::Base.deliveries.size }.by(0)
order = club.billing_transfer_orders.last
expect(order).to be_awaiting_payment
@@ -41,16 +41,14 @@ RSpec.describe Billing::RequestBankTransfer do
expect(club.reload.subscription.plan.slug).to eq("free")
end
it "crea comunque l'ordine se in produzione manca SMTP" do
allow(MatchLiveTv).to receive(:smtp_configured?).and_return(false)
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new("production"))
it "non reinvia istruzioni se l'ordine è già in attesa" do
first = described_class.call(club: club, user: user, plan_slug: "premium_light", interval: "yearly")
ActionMailer::Base.deliveries.clear
expect {
described_class.call(club: club, user: user, plan_slug: "premium_light", interval: "yearly")
}.to change { club.billing_transfer_orders.count }.by(1)
.and change { ActionMailer::Base.deliveries.size }.by(0)
expect(club.billing_transfer_orders.last).to be_awaiting_payment
second = described_class.call(club: club, user: user, plan_slug: "premium_light", interval: "yearly")
expect(second.id).to eq(first.id)
}.not_to change { ActionMailer::Base.deliveries.size }
end
it "usa l'importo concordato se presente" do