Adds a delete button to the purchase show page, hooked to the existin… #1646
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.
…g destroy action in the Purchase controller. Restricts deletion of a purchase to organization and super admin.
Resolves #1640
Description
Adds a delete button to the Purchase show page to make use of the existing destroy action. Also uses the authorize_admin method to restrict use of the destroy action.
Type of change
How Has This Been Tested?
New request and system specs where added to exercise the new code.
Full test suite was run and was green.
Rubocop -a was run with no violations
Feature was manually tested in the development environment.
Screenshots
Purchase show page, before:
![purchase_show_before](https://user-images.githubusercontent.com/7053190/80314925-8e5baf80-87c2-11ea-8a92-98b908e35fb4.png)
Purchase show page, after:
![purchase_show_after](https://user-images.githubusercontent.com/7053190/80314932-97e51780-87c2-11ea-959d-37f9769e9343.png)