mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
don't allow edits to adjustments for canceled orders
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
%td.align-center.label= adjustment.label
|
||||
%td.align-center.amount= adjustment.display_amount.to_html
|
||||
%td.align-center.included-tax= adjustment.display_included_tax.to_html
|
||||
%td.actions
|
||||
= link_to_edit adjustment, no_text: true
|
||||
= link_to_delete adjustment, no_text: true
|
||||
- unless @order.canceled?
|
||||
%td.actions
|
||||
= link_to_edit adjustment, no_text: true
|
||||
= link_to_delete adjustment, no_text: true
|
||||
|
||||
@@ -87,4 +87,17 @@ feature '
|
||||
expect(page).to have_selector 'td.amount', text: '110'
|
||||
expect(page).to have_selector 'td.included-tax', text: '10'
|
||||
end
|
||||
|
||||
scenario "viewing adjustments on a canceled order" do
|
||||
# Given a taxed adjustment
|
||||
adjustment = create(:adjustment, label: "Extra Adjustment", adjustable: order,
|
||||
amount: 110, included_tax: 10, order: order)
|
||||
order.cancel!
|
||||
|
||||
login_as_admin_and_visit spree.edit_admin_order_path(order)
|
||||
|
||||
click_link 'Adjustments'
|
||||
|
||||
expect(page).to_not have_selector('tr a.icon-edit')
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user