-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
Display warning if editing an audited purchase/donation #4086
Display warning if editing an audited purchase/donation #4086
Conversation
816000e
to
0fedf2c
Compare
317de4e
to
d2c5255
Compare
f08978e
to
960a7d6
Compare
6a3396c
to
bc32610
Compare
create(:audit, storage_location: storage_location3, line_items_attributes: [{item_id: storage_location3.items.first.id, quantity: 10}]) | ||
create(:audit, storage_location: storage_location1, status: "finalized", line_items_attributes: [{item_id: storage_location1.items.first.id, quantity: 5}]) | ||
create(:audit, storage_location: storage_location3, status: "finalized", line_items_attributes: [{item_id: storage_location3.items.first.id, quantity: 10}]) | ||
create(:audit, storage_location: storage_location5, status: "confirmed", line_items_attributes: [{item_id: storage_location5.items.first.id, quantity: 10}]) |
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.
Added new audit here and an assertion below to account for non-finalized case.
spec/system/donation_system_spec.rb
Outdated
@@ -607,6 +607,56 @@ | |||
total_quantity = find("#donation_quantity").text | |||
expect(total_quantity).to eq "0 (Total)" | |||
end | |||
|
|||
context "when an finalized audit has been performed on the donated items" do |
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.
All 3 of these tests should be request tests, not system tests. They're not interactive, so there's no reason to run them in a browser.
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.
@dorner converted the system specs into request specs.
spec/system/purchase_system_spec.rb
Outdated
@@ -295,6 +295,60 @@ | |||
expect(page).to_not have_link("Delete") | |||
end | |||
end | |||
|
|||
context "when editing an existing purchase" do |
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.
Ditto these.
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.
@dorner these are converted now as well
75afd74
to
bca57d3
Compare
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.
Thanks! In the future, please don't force-push your branch so that it's easier to review the new commits.
@vincent-truong-dev: Your PR |
Closes #4080
Description
Displays a warning on the donation and purchase edit page if there has been an audit on the donation or purchase since their creation.
Type of change
New feature (non-breaking change which adds functionality)
How Has This Been Tested?
Assume logged in
Screenshots