Files
MatchLiveTv/backend/spec/services/billing/payment_description_spec.rb
eminuxandCursor 3ed70b6999 Aggiorna marketing: prezzi lancio, Funzionalità narrativa e link store.
Allinea i piani Light/Full ai prezzi di lancio, ripensa /funzionalita per vendere il prodotto e aggiunge i badge App Store/Play nella home.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 23:00:17 +02:00

29 lines
887 B
Ruby

require "rails_helper"
RSpec.describe Billing::PaymentDescription do
before { load Rails.root.join("db/seeds/plans.rb") }
it "etichetta da piano e intervallo Stripe" do
invoice = double(
amount_paid: 500,
metadata: { "plan_slug" => "premium_light", "billing_interval" => "monthly" },
lines: double(data: [])
)
expect(described_class.for_stripe_invoice(invoice)).to eq("Premium Light — €7,90/mese")
end
it "ignora descrizioni di test nel pagamento salvato" do
payment = Billing::Payment.new(
description: "Webhook test",
plan_slug: "premium_light",
amount_cents: 4000,
currency: "eur",
status: "paid",
club: Club.create!(name: "C", sport: "volleyball", primary_color: "#e53935", secondary_color: "#ffffff")
)
expect(payment.display_description).to eq("Premium Light — €59/anno")
end
end