Billing Stripe, link regia mobile e staff solo trasmissione.
Aggiunge fatturazione club, pagina regia condivisibile senza account, roster squadre e rimuove la modalità controller dall'app (v1.1.0). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
27
backend/spec/models/billing/invoice_spec.rb
Normal file
27
backend/spec/models/billing/invoice_spec.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe Billing::Invoice do
|
||||
let(:club) { Club.create!(name: "Invoice Club", sport: "volleyball", primary_color: "#e53935", secondary_color: "#ffffff") }
|
||||
|
||||
it "richiede PDF per fatture emesse" do
|
||||
invoice = club.billing_invoices.build(
|
||||
number: "2026/001",
|
||||
issued_on: Date.current,
|
||||
amount_cents: 4000,
|
||||
status: "issued"
|
||||
)
|
||||
expect(invoice).not_to be_valid
|
||||
expect(invoice.errors[:pdf]).to be_present
|
||||
end
|
||||
|
||||
it "accetta bozza senza PDF" do
|
||||
invoice = club.billing_invoices.create!(
|
||||
number: "2026/002",
|
||||
issued_on: Date.current,
|
||||
amount_cents: 4000,
|
||||
status: "draft"
|
||||
)
|
||||
expect(invoice).to be_persisted
|
||||
expect(invoice.downloadable?).to be false
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user