diff --git a/app/controllers/events/callouts_controller.rb b/app/controllers/events/callouts_controller.rb index 80ba2c2bf..c73681816 100644 --- a/app/controllers/events/callouts_controller.rb +++ b/app/controllers/events/callouts_controller.rb @@ -14,7 +14,7 @@ class CalloutsController < ApplicationController HANDOUT_RESOURCE_TITLES = [ "2-Day AWBW Facilitator Training Worksheets & Handouts", "AWBW Training Workshop Worksheets", - "AHA Moments", + "Aha Moments", "Inviting and Responding to Participants' Sharing", "Letter to Supervisors" ].freeze @@ -24,7 +24,7 @@ class CalloutsController < ApplicationController "List of resources and worksheets we will reference and utilize during the training. You do not need to print them out, it may be helpful for you to access the links during the training.", "AWBW Training Workshop Worksheets" => "Worksheets you can create on during all 5 of the art workshops at the training. Any art materials are welcomed during creation.", - "AHA Moments" => + "Aha Moments" => "Worksheet you can use to reflect on the workshop, its impact, and how you'd like to apply it.", "Inviting and Responding to Participants' Sharing" => "A resource to invite and support sharing, active listening, and connection during breakout rooms.", diff --git a/app/views/events/callouts/_resource_body.html.erb b/app/views/events/callouts/_resource_body.html.erb index 4b22d0e80..4f2f0b841 100644 --- a/app/views/events/callouts/_resource_body.html.erb +++ b/app/views/events/callouts/_resource_body.html.erb @@ -8,7 +8,7 @@ <% unless resource.single_page_pdf? %> The preview shows the first page only — download to get all pages. <% end %> - <%= link_to resource_download_path(resource), download: true, class: "btn btn-utility" do %> + <%= link_to url_for(resource.downloadable_asset.file), download: true, class: "btn btn-utility" do %> Download <% end %> diff --git a/spec/requests/events/registration_ticket_callouts_spec.rb b/spec/requests/events/registration_ticket_callouts_spec.rb index 037b6d8ec..7a8104021 100644 --- a/spec/requests/events/registration_ticket_callouts_spec.rb +++ b/spec/requests/events/registration_ticket_callouts_spec.rb @@ -43,7 +43,7 @@ get event_registration_ticket_callout_path(event, callout) expect(response).to have_http_status(:ok) - expect(response.body).to include(resource_download_path(resource)) + expect(response.body).to include(rails_blob_path(resource.downloadable_asset.file, only_path: true)) end it "does not find a callout belonging to a different event" do @@ -68,7 +68,7 @@ expect(response).to have_http_status(:ok) expect(response.body).to include("Read this first.") - expect(response.body).to include(resource_download_path(resource)) + expect(response.body).to include(rails_blob_path(resource.downloadable_asset.file, only_path: true)) end end @@ -83,7 +83,7 @@ get event_registration_ticket_callout_path(event, callout) expect(response).to have_http_status(:ok) - expect(response.body).not_to include(resource_download_path(resource)) + expect(response.body).not_to include("fa-download") end end end diff --git a/spec/requests/events/registrations_spec.rb b/spec/requests/events/registrations_spec.rb index ad62ba076..f9ecb2b57 100644 --- a/spec/requests/events/registrations_spec.rb +++ b/spec/requests/events/registrations_spec.rb @@ -259,7 +259,7 @@ let!(:registration) { create(:event_registration, event: event, registrant: user.person) } it "links each handout to its registrant resource page, returning to handouts" do - handout = create(:resource, title: "AHA Moments", kind: "Handout") + handout = create(:resource, title: "Aha Moments", kind: "Handout") get registration_handouts_path(registration.slug) expect(response).to have_http_status(:success) expect(response.body).to include(registration_resource_path(registration.slug, handout, return_to: "handouts")) @@ -275,19 +275,19 @@ let!(:registration) { create(:event_registration, event: event, registrant: user.person) } it "renders the resource with a back-to-ticket link and a download button" do - resource = create(:resource, title: "AHA Moments", kind: "Handout") + resource = create(:resource, title: "Aha Moments", kind: "Handout") create(:downloadable_asset, owner: resource) get registration_resource_path(registration.slug, resource) expect(response).to have_http_status(:success) - expect(response.body).to include("AHA Moments") + expect(response.body).to include("Aha Moments") expect(response.body).to include(registration_ticket_path(registration.slug)) - expect(response.body).to include(resource_download_path(resource)) + expect(response.body).to include(rails_blob_path(resource.downloadable_asset.file, only_path: true)) end it "prompts to download for all pages on a multi-page resource" do - resource = create(:resource, title: "AHA Moments", kind: "Handout") + resource = create(:resource, title: "Aha Moments", kind: "Handout") create(:downloadable_asset, owner: resource) get registration_resource_path(registration.slug, resource) @@ -305,7 +305,7 @@ end it "is reachable by slug without logging in" do - resource = create(:resource, title: "AHA Moments", kind: "Handout") + resource = create(:resource, title: "Aha Moments", kind: "Handout") get registration_resource_path(registration.slug, resource) @@ -313,7 +313,7 @@ end it "returns to the handouts callout with a 'Handouts detail' header when reached from handouts" do - resource = create(:resource, title: "AHA Moments", kind: "Handout") + resource = create(:resource, title: "Aha Moments", kind: "Handout") get registration_resource_path(registration.slug, resource, return_to: "handouts") @@ -321,7 +321,7 @@ expect(response.body).to include("Back to handouts") expect(response.body).not_to include("Back to ticket") expect(response.body).to include("Handouts detail") - expect(response.body).to include("AHA Moments") + expect(response.body).to include("Aha Moments") end it "returns to the forms callout with a 'Forms detail' header when reached from forms" do