Skip to content

Commit

Permalink
Creator search link (#1082)
Browse files Browse the repository at this point in the history
* allow special characters for search from showpage link

* adds spec for clicking creator link

---------

Co-authored-by: JP Engstrom <jpengstrom@macbook-pro.lan>
  • Loading branch information
jpengst and JP Engstrom authored Jan 29, 2025
1 parent 94d829d commit b1da001
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/helpers/blacklight_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def generate_creators_text(args)

def generate_creators_links(args)
generate_creators(args) do |creator|
link = "/catalog?f%5Bcreator_ssim%5D%5B%5D=#{creator}"
link = "/catalog?f%5Bcreator_ssim%5D%5B%5D=#{Rack::Utils.escape(creator)}"
link_to(creator, link)
end
end
Expand Down
10 changes: 7 additions & 3 deletions spec/system/show_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
genre_ssim: 'Maps',
ancestorTitles_tesim: ['Level0', 'Level1', 'Level2', 'Level3', 'Oversize', 'Abraham Lincoln collection (GEN MSS 257)', 'Beinecke Rare Book and Manuscript Library (BRBL)'],
resourceType_ssim: 'Maps, Atlases & Globes',
creator_ssim: ['Anna Elizabeth Dewdney'],
creator_tesim: ['Anna Elizabeth Dewdney'],
creator_ssim: ['Anna Elizabeth Dewdney + Another Creator'],
creator_tesim: ['Anna Elizabeth Dewdney + Another Creator'],
child_oids_ssim: [112, 113],
oid_ssi: 111,
thumbnail_path_ss: "https://this_is_a_iiif_image/iiif/2/17120080/full/#{thumbnail_size_in_solr}/0/default.jpg",
Expand Down Expand Up @@ -377,7 +377,7 @@
expect(page.html).to include("og:type")
expect(page.html).to include("website")
expect(page.html).to include("og:description")
expect(page.html).to include("Anna Elizabeth Dewdney")
expect(page.html).to include("Anna Elizabeth Dewdney + Another Creator")
expect(page.html).to include("og:image")
expect(page.html).to include("https://this_is_a_iiif_image/iiif/2/17120080/full/#{thumbnail_size_in_opengraph}/0/default.jpg")
expect(page.html).to include("og:image:type")
Expand All @@ -393,6 +393,10 @@
expect(page).to have_content "Access And Usage Rights"
expect(page).to have_content "Identifiers"
end
it "can click on a Creator link with special characters and return correct search results" do
click_on("Anna Elizabeth Dewdney + Another Creator")
expect(page).to have_content "Amor Llama"
end

context 'Universal Viewer' do
it 'does not have a .json extension in the src attribute' do
Expand Down

0 comments on commit b1da001

Please sign in to comment.