Merge pull request #7265 from andrewpbrett/freeze-adjustments

Don't allow edits to adjustments for canceled orders
This commit is contained in:
Andy Brett
2021-04-06 10:56:27 -07:00
committed by GitHub
3 changed files with 20 additions and 4 deletions

View File

@@ -87,4 +87,18 @@ 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')
expect(page).to_not have_selector('a.icon-plus'), text: I18n.t(:new_adjustment)
end
end