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
2 changes: 1 addition & 1 deletion app/helpers/containers_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def contest_description_action_links(container, description)

def render_eligibility_rules(description)
eligibility_plain = description.eligibility_rules.to_plain_text
if eligibility_plain.length > 100
if eligibility_plain.length > 60
content_tag(:div) do
truncate(eligibility_plain, length: 60, omission: '') +
link_to(' ...more', '#',
Expand Down
2 changes: 1 addition & 1 deletion app/views/containers/_entries_summary.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div>
<div class="row">
<div class="col-12">
<h5 class="mb-3">Total Entries in all Active Contests: <%= container.total_active_entries %></h5>
<h5 class="mb-3">Total Entries in all Active Instances of Active Contests: <%= container.total_active_entries %></h5>

<% if container.entries_summary.any? %>
<h6 class="mb-2">Entries by Campus:</h6>
Expand Down
8 changes: 4 additions & 4 deletions spec/helpers/containers_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
end

describe "#render_eligibility_rules" do
context "when eligibility rules are longer than 100 characters" do
let(:long_text) { "These are very long eligibility rules that will definitely exceed the 100 character limit and therefore trigger the modal functionality." }
context "when eligibility rules are longer than 60 characters" do
let(:long_text) { "These are very long eligibility rules that will definitely exceed the 60 character limit and therefore trigger the modal functionality." }
let(:rich_text) { instance_double(ActionText::RichText, to_plain_text: long_text) }

before do
Expand All @@ -66,10 +66,10 @@
expect(link['data-action']).to eq('click->modal#open')
expect(link['data-modal-title']).to eq('Eligibility Rules')
expect(link['href']).to eq('#')
expect(link.text).to eq('...more')
expect(link.text).to eq(' ...more')

# Check truncated text
expect(parsed_result.text).to include(long_text[0..99])
expect(parsed_result.text).to include(long_text[0..59])
end
end

Expand Down
Loading