-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
4635: Comment is missing from purchase details #4642
Changes from 2 commits
4f96571
1731bfe
803a9dd
834f25f
83ee754
1364f82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,17 @@ | |
<td><%= @purchase.storage_view %></td> | ||
</tr> | ||
</table> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Comment:</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td><%= @purchase.comment_view %></td> | ||
</tr> | ||
</table> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you fix up the spacing here? Nested elements like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I fixed here 834f25f |
||
</div> | ||
</div> | ||
</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -264,7 +264,20 @@ | |
|
||
describe "GET #show" do | ||
let(:item) { create(:item) } | ||
let!(:purchase) { create(:purchase, :with_items, item: item) } | ||
let(:storage_location) { create(:storage_location, organization: organization, name: 'Some Storage') } | ||
let(:vendor) { create(:vendor, organization: organization, business_name: 'Another Business') } | ||
let!(:purchase) { create(:purchase, :with_items, item: item, storage_location: storage_location, comment: 'Fine day for diapers, it is.') } | ||
|
||
it "shows the purchase info" do | ||
escaped_html_comment = CGI.escapeHTML(purchase.comment_view) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You know exactly what the comment is - please use that value in your expectation instead of referencing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made the changes here 83ee754 |
||
date_of_purchase = "#{purchase.issued_at.to_fs(:distribution_date)} (entered: #{purchase.created_at.to_fs(:distribution_date)})" | ||
|
||
get purchase_path(id: purchase.id) | ||
expect(response.body).to include(date_of_purchase) | ||
expect(response.body).to include(purchase.purchased_from_view) | ||
expect(response.body).to include(purchase.storage_view) | ||
expect(response.body).to include(escaped_html_comment) | ||
end | ||
|
||
it "shows an enabled edit button" do | ||
get purchase_path(id: purchase.id) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this deserves a full method of its own. You can replace with
purchase.comment || ''
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the changes here 803a9dd