-
-
Notifications
You must be signed in to change notification settings - Fork 573
Disallow saving Purchase with a quantity of 0 (5507) #5510
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
base: main
Are you sure you want to change the base?
Changes from all commits
133f5b8
e6cfb13
03cd071
707b22a
eea3f43
644e2e5
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 |
|---|---|---|
|
|
@@ -34,7 +34,12 @@ | |
| context "when minimum_quantity is 0 and recommended_quantity is nil and item quantity is 0" do | ||
| let(:item) { create :item, organization: organization } | ||
| let(:minimum_quantity) { 0 } | ||
| let(:inventory_item_quantity) { 0 } | ||
|
|
||
| # Use TestInventory to set up inventory directly, instead of creating | ||
| # a purchase with 0 quantity items (which our validation now rejects). | ||
| before do | ||
|
Collaborator
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. Question: What was this needed to solve this issue?
Author
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. The original test in |
||
| TestInventory.create_inventory(organization, {storage_location.id => {item.id => 0}}) | ||
| end | ||
|
|
||
| it { is_expected.to eq [] } | ||
| end | ||
|
|
||
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.
You don't need to, but it is also fun to test for a quantity less than zero :)