Skip to content

Commit

Permalink
Adds comments field to purchase index view (#4368)
Browse files Browse the repository at this point in the history
* Adds comments field to purchase index view

- Shows comments in purchase index view
- Added relevant system spec

* Fixes typo and lint issues

* Replaced system spec with request spec
  • Loading branch information
vsrnth authored May 22, 2024
1 parent 42d8804 commit 46ec038
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
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

0 comments on commit 46ec038

Please sign in to comment.