Mostra il piano attivo dopo il bonifico e allinea il flusso società.
Dopo la conferma admin la card restava su «Paga con bonifico»; la società parte da Free, l'owner è staff trasmissione e le mail non bloccano se manca SMTP. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -26,7 +26,7 @@ RSpec.describe Billing::RequestBankTransfer do
|
||||
)
|
||||
end
|
||||
|
||||
it "crea un ordine a listino e invia le istruzioni" do
|
||||
it "crea l'ordine a listino e invia 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)
|
||||
@@ -41,6 +41,18 @@ 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"))
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
it "usa l'importo concordato se presente" do
|
||||
Billing::SetClubQuote.upsert(
|
||||
club: club, plan_slug: "premium_full", interval: "yearly",
|
||||
|
||||
@@ -19,6 +19,12 @@ RSpec.describe Teams::StaffAssignment do
|
||||
expect(team.entitlements.staff_count_for("transmission")).to eq(1)
|
||||
end
|
||||
|
||||
it "designa il titolare della società sulla squadra" do
|
||||
described_class.designate_club_owner!(team: team, user: owner)
|
||||
membership = owner.user_teams.find_by!(team: team)
|
||||
expect(membership.staff_kind).to eq("transmission")
|
||||
end
|
||||
|
||||
it "rejects duplicate email for transmission" do
|
||||
UserTeam.create!(user: other, team: team, role: "member", staff_kind: "transmission")
|
||||
expect {
|
||||
|
||||
Reference in New Issue
Block a user