Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: APPS-2680 html tags and "read more" button for the search results #1152

Merged
merged 7 commits into from
Aug 29, 2024
4 changes: 2 additions & 2 deletions app/helpers/ursus/catalog_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def render_truncated_description(args)
description = args[:value].first
button = "<span class='view-more' href>Read More <div class='down-arrow'>&raquo;</div></span></br>"
truncated_output << "<div class='description'>#{description}</div>#{button}</br>"
# return truncated_output.html_safe
return description
# rubocop:disable Rails::OutputSafety
truncated_output.html_safe
end
end
end
Expand Down
5 changes: 3 additions & 2 deletions spec/system/search_catalog_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
has_model_ssim: ['Work'],
title_tesim: ['Orange Carrot'],
photographer_tesim: ['Bittersweet Tangerine'],
description_tesim: ['Long description Long description Long description Long description Long description Long description']
description_tesim: ['Long description Long description Long description<br>Long description Long description Long description']
}
end

Expand Down Expand Up @@ -147,7 +147,8 @@
# Search for something
fill_in 'q', with: 'carrot'
click_on 'search'
expect(page).not_to have_content('Read More')
expect(page).to have_content('Read More')
expect(page).not_to have_content('<br>')
end

context 'when the sinai? flag is disabled' do
Expand Down
Loading