Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/controllers/events/callouts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion app/views/events/callouts/_resource_body.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<% unless resource.single_page_pdf? %>
<span class="text-xs text-gray-500">The preview shows the first page only — download to get all pages.</span>
<% 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 <i class="fa-solid fa-download"></i>
<% end %>
</div>
Expand Down
6 changes: 3 additions & 3 deletions spec/requests/events/registration_ticket_callouts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down
16 changes: 8 additions & 8 deletions spec/requests/events/registrations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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)
Expand All @@ -305,23 +305,23 @@
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)

expect(response).to have_http_status(:success)
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")

expect(response.body).to include(registration_handouts_path(registration.slug))
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
Expand Down