fix(tests): Remove service fee expectation from Stripe invoice test and fix duplicated keys in event view

- Update StripeInvoiceServiceTest to match the implementation that no longer adds service fees to customer invoices
- Remove duplicated Stimulus data attributes in events/show.html.erb that were causing warnings
- Align tests with the hybrid fee model where fees are deducted from promoter payouts
This commit is contained in:
kbe
2025-09-16 17:22:00 +02:00
parent 5279ebe1a4
commit 04393add14
2 changed files with 4 additions and 19 deletions

View File

@@ -137,8 +137,6 @@
ticket_selection_event_slug_value: @event.slug, ticket_selection_event_slug_value: @event.slug,
ticket_selection_event_id_value: @event.id, ticket_selection_event_id_value: @event.id,
ticket_selection_order_new_url_value: event_order_new_path(@event.slug, @event.id), ticket_selection_order_new_url_value: event_order_new_path(@event.slug, @event.id),
ticket_selection_store_cart_url_value: api_v1_store_cart_path,
ticket_selection_order_new_url_value: event_order_new_path(@event.slug, @event.id),
ticket_selection_store_cart_url_value: api_v1_store_cart_path ticket_selection_store_cart_url_value: api_v1_store_cart_path
} do |form| %> } do |form| %>

View File

@@ -210,25 +210,12 @@ class StripeInvoiceServiceTest < ActiveSupport::TestCase
} }
} }
expected_service_fee_line_item = {
customer: "cus_test123",
invoice: "in_test123",
amount: 100,
currency: "eur",
description: "Frais de service - Frais de traitement de la commande",
metadata: {
item_type: "service_fee",
amount_cents: 100
}
}
mock_invoice = mock("invoice") mock_invoice = mock("invoice")
mock_invoice.stubs(:id).returns("in_test123") mock_invoice.stubs(:id).returns("in_test123")
mock_invoice.stubs(:finalize_invoice).returns(mock_invoice) mock_invoice.stubs(:finalize_invoice).returns(mock_invoice)
mock_invoice.expects(:pay) mock_invoice.expects(:pay)
Stripe::Invoice.expects(:create).returns(mock_invoice) Stripe::Invoice.expects(:create).returns(mock_invoice)
Stripe::InvoiceItem.expects(:create).with(expected_ticket_line_item) Stripe::InvoiceItem.expects(:create).with(expected_ticket_line_item) # Only for tickets, no service fee
Stripe::InvoiceItem.expects(:create).with(expected_service_fee_line_item)
result = @service.create_post_payment_invoice result = @service.create_post_payment_invoice
assert_not_nil result assert_not_nil result