+
+ Admin only
+
Payment allocations
<%= render "events/payment_badge", payment: @payment %>
diff --git a/spec/decorators/event_decorator_spec.rb b/spec/decorators/event_decorator_spec.rb
index a71071d298..dc53a71588 100644
--- a/spec/decorators/event_decorator_spec.rb
+++ b/spec/decorators/event_decorator_spec.rb
@@ -111,6 +111,33 @@
end
end
+ describe "#short_date_range" do
+ it "shows a single date without a weekday when there is no end date" do
+ event = build(:event, start_date: Time.zone.local(2026, 6, 11, 12), end_date: nil).decorate
+ expect(event.short_date_range).to eq("Jun 11, 2026")
+ end
+
+ it "shows a single date when start and end fall on the same day" do
+ event = build(:event, start_date: Time.zone.local(2026, 6, 11, 9), end_date: Time.zone.local(2026, 6, 11, 17)).decorate
+ expect(event.short_date_range).to eq("Jun 11, 2026")
+ end
+
+ it "collapses month and year for a same-month range" do
+ event = build(:event, start_date: Time.zone.local(2026, 9, 20, 9), end_date: Time.zone.local(2026, 9, 21, 17)).decorate
+ expect(event.short_date_range).to eq("Sep 20-21, 2026")
+ end
+
+ it "collapses only the year for a same-year, cross-month range" do
+ event = build(:event, start_date: Time.zone.local(2026, 6, 30, 9), end_date: Time.zone.local(2026, 7, 2, 17)).decorate
+ expect(event.short_date_range).to eq("Jun 30 - Jul 2, 2026")
+ end
+
+ it "shows both years for a cross-year range" do
+ event = build(:event, start_date: Time.zone.local(2025, 12, 31, 9), end_date: Time.zone.local(2026, 1, 2, 17)).decorate
+ expect(event.short_date_range).to eq("Dec 31, 2025 - Jan 2, 2026")
+ end
+ end
+
describe "#labelled_cost" do
it "returns nil when cost_cents is nil" do
event = build(:event, cost_cents: nil).decorate
diff --git a/spec/requests/events/bulk_payments_spec.rb b/spec/requests/events/bulk_payments_spec.rb
index 4fa2d23cc7..711a6c32a2 100644
--- a/spec/requests/events/bulk_payments_spec.rb
+++ b/spec/requests/events/bulk_payments_spec.rb
@@ -272,6 +272,23 @@ def get_ticket
expect(response.body).to include("jordan@example.com")
end
+ it "shows the payer's name, organization, and registrants-covered count" do
+ submission.form_answers.create!(form_field: payer_first_name_field, submitted_answer: "Alex",
+ question_name_when_answered: "Payer first name")
+ submission.form_answers.create!(form_field: payer_last_name_field, submitted_answer: "Chen",
+ question_name_when_answered: "Payer last name")
+ submission.form_answers.create!(form_field: org_field, submitted_answer: "Bright Futures Academy",
+ question_name_when_answered: "Organization")
+
+ get_ticket
+
+ expect(response.body).to include("Payer")
+ expect(response.body).to include("Alex Chen")
+ expect(response.body).to include("Bright Futures Academy")
+ # One attendee is listed and no explicit count is set, so the covered count is 1.
+ expect(response.body).to include("Covering 1 registrant")
+ end
+
it "does not show per-person actions like cancelling a registration" do
get_ticket
@@ -284,9 +301,10 @@ def get_ticket
expect(response.body).to include("return_to=bulk_payment_ticket")
end
- it "links 'View submission' to the public submission page" do
+ it "links 'View your form responses' to the public submission page" do
get_ticket
+ expect(response.body).to include("View your form responses")
expect(response.body).to include(event_bulk_payment_path(event, reg: submission.slug))
end