diff --git a/app/views/donations/_donation_row.html.erb b/app/views/donations/_donation_row.html.erb index b9fcf04868..935b63089e 100644 --- a/app/views/donations/_donation_row.html.erb +++ b/app/views/donations/_donation_row.html.erb @@ -1,16 +1,14 @@ + <%= donation_row.issued_at.strftime("%F") %> <%= donation_row.source %> - <%= donation_row.issued_at.strftime("%F") %> - <%= donation_row.details %> - <%= donation_row.storage_location.name %> - <%= donation_row.line_items.total %> - <%= dollar_value(donation_row.money_raised.to_i) %> - <%= dollar_value(donation_row.value_per_itemizable) %> - <%= truncate donation_row.comment, length: 140, separator: /\w+/ %> - - <%= view_button_to donation_path(donation_row) %> - <%= print_button_to print_donation_path(donation_row, format: :pdf) %> - - + <%= donation_row.details %> + <%= donation_row.storage_location.name %> + <%= donation_row.line_items.total %> + <%= dollar_value(donation_row.money_raised.to_i) %> + <%= dollar_value(donation_row.value_per_itemizable) %> + <%= truncate donation_row.comment, length: 140, separator: /\w+/ %> + + <%= view_button_to donation_path(donation_row) %> + <%= print_button_to print_donation_path(donation_row, format: :pdf) %> diff --git a/app/views/donations/index.html.erb b/app/views/donations/index.html.erb index c3347ebe4c..f128e67b9d 100644 --- a/app/views/donations/index.html.erb +++ b/app/views/donations/index.html.erb @@ -137,8 +137,8 @@ - + diff --git a/spec/requests/donations_requests_spec.rb b/spec/requests/donations_requests_spec.rb index fe12b80fcf..29e42717a9 100644 --- a/spec/requests/donations_requests_spec.rb +++ b/spec/requests/donations_requests_spec.rb @@ -69,7 +69,9 @@ end context "when given a misc donation" do - let(:full_comment) { Faker::Lorem.paragraph } + # Comment must be longer than the 140 characters the Comments column + # truncates at, so that asserting the full comment is absent is meaningful. + let(:full_comment) { Faker::Lorem.paragraph_by_chars(number: 200) } let(:donation) { create(:donation, source: "Misc. Donation", comment: full_comment) } it "should display Misc Donation and a truncated comment" do
Source DateSource Details Storage Location Quantity of Items