[#4594] allow zero inventory items to be selected for audit #4833
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #4594
Description
Allow newly added items that are not in a storage location to be selected for audit, which effectively initializes them.
Also ensure inactive items cannot be selected for audit. That last part about inactive items was discovered in further discussion on the issue.
Type of change
Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
For automated testing, see two new tests added to
spec/system/audit_system_spec.rb
:For manual testing, create a new item, then create a new audit, pick a storage location, you should be able to select the new item for audit.
Also on the new audit screen, if you interact with the item dropdown before selecting a storage location, it should not include inactive items. In the seed data,
Adult Briefs (Large/X-Large)
is an inactive item.Screenshots
Create new item:
Verify item not in any location:
Start new audit - new item is selectable:
Save progress - item shows up: