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

Adds comments field to purchase index view #4368

Merged
merged 6 commits into from
May 22, 2024
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
1 change: 1 addition & 0 deletions app/views/purchases/_purchase_row.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<tr>
<td><%= purchase_row.purchased_from_view %></td>
<td><%= purchase_row.storage_location.name %></td>
<td><%= purchase_row.comment %></td>
<td class="numeric"><%= purchase_row.line_items.total %></td>
<td class="numeric"><%= purchase_row.line_items.size %></td>
<td class="numeric"><%= dollar_value(purchase_row.amount_spent_in_cents) %></td>
Expand Down
1 change: 1 addition & 0 deletions app/views/purchases/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<tr>
<th>Purchases from</th>
<th>Storage Location</th>
<th>Comments</th>
<th>Quantity of Items</th>
<th>Variety of Items</th>
<th>Amount spent</th>
Expand Down
6 changes: 6 additions & 0 deletions spec/requests/purchases_requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
expect(subject.body).to include("FMV")
expect(subject.body).to include("$0.84")
end

it "shows the Comments column" do
create(:purchase, comment: "Purchase Comment", organization: organization)
expect(subject.body).to include("Comments")
expect(subject.body).to include("Purchase Comment")
end
end

context "csv" do
Expand Down