Skip to content
Open
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
22 changes: 10 additions & 12 deletions app/views/donations/_donation_row.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<tr>
<td class="text-left date"><%= donation_row.issued_at.strftime("%F") %></td>
<td><%= donation_row.source %></td>
<td class="text-left date"><%= donation_row.issued_at.strftime("%F") %>
<td><%= donation_row.details %></td>
<td><%= donation_row.storage_location.name %></td>
<td class="numeric"><%= donation_row.line_items.total %></td>
<td class="numeric"><%= dollar_value(donation_row.money_raised.to_i) %></td>
<td class="numeric"><%= dollar_value(donation_row.value_per_itemizable) %></td>
<td><%= truncate donation_row.comment, length: 140, separator: /\w+/ %>
<td class="text-right">
<%= view_button_to donation_path(donation_row) %>
<%= print_button_to print_donation_path(donation_row, format: :pdf) %>
</td>
</td>
<td><%= donation_row.details %></td>
<td><%= donation_row.storage_location.name %></td>
<td class="numeric"><%= donation_row.line_items.total %></td>
<td class="numeric"><%= dollar_value(donation_row.money_raised.to_i) %></td>
<td class="numeric"><%= dollar_value(donation_row.value_per_itemizable) %></td>
<td><%= truncate donation_row.comment, length: 140, separator: /\w+/ %></td>
<td class="text-right">
<%= view_button_to donation_path(donation_row) %>
<%= print_button_to print_donation_path(donation_row, format: :pdf) %>
</td>
</tr>
2 changes: 1 addition & 1 deletion app/views/donations/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
<table class="table table-hover">
<thead>
<tr>
<th>Source</th>
<th>Date</th>
<th>Source</th>
<th>Details</th>
<th>Storage Location</th>
<th class="text-right">Quantity of Items</th>
Expand Down
4 changes: 3 additions & 1 deletion spec/requests/donations_requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down