diff --git a/spec/models/registration_ticket_callout_spec.rb b/spec/models/registration_ticket_callout_spec.rb index 24cad46d8..e017eabd1 100644 --- a/spec/models/registration_ticket_callout_spec.rb +++ b/spec/models/registration_ticket_callout_spec.rb @@ -80,6 +80,15 @@ expect(other.payment?).to be(false) expect(custom.payment?).to be(false) end + + it "treats art_supplies as a content built-in (renders its own page), not behavioral" do + event = create(:event) + art_supplies = create(:registration_ticket_callout, event:, builtin_key: "art_supplies") + certificate = create(:registration_ticket_callout, event:, builtin_key: "certificate") + + expect(art_supplies.behavioral_builtin?).to be(false) + expect(certificate.behavioral_builtin?).to be(true) + end end describe "#published (inverse of hidden)" do diff --git a/spec/requests/events/callouts_spec.rb b/spec/requests/events/callouts_spec.rb index 359afa6f7..188267536 100644 --- a/spec/requests/events/callouts_spec.rb +++ b/spec/requests/events/callouts_spec.rb @@ -35,6 +35,35 @@ end end + # The intro copy an admin types into a built-in's materialized callout row (its + # "Callout page text" / description) renders on that built-in's public page. CE + # and scholarship previously had no request-layer coverage of this; the FAQ case + # is covered above, and handouts has no description intro (resource cards only). + describe "built-in page copy from the callout row description" do + it "renders the CE callout's description on the CE page" do + BuiltinCallouts.seed(event) + event.registration_ticket_callouts.find_by(builtin_key: "ce_hours") + .update!(description: "

Bring your license number.

", hidden: false) + + get registration_ce_path(registration.slug) + + expect(response).to have_http_status(:success) + expect(response.body).to include("Bring your license number.") + end + + it "renders the scholarship callout's description on the scholarship page" do + registration.update!(scholarship_requested: true) + BuiltinCallouts.seed(event) + event.registration_ticket_callouts.find_by(builtin_key: "scholarship") + .update!(description: "

About your scholarship.

", hidden: false) + + get registration_scholarship_path(registration.slug) + + expect(response).to have_http_status(:success) + expect(response.body).to include("About your scholarship.") + end + end + describe "GET /registration/:slug/handouts" do it "renders the handouts page when its callout is published" do create(:registration_ticket_callout, event:, builtin_key: "handouts", hidden: false)