diff --git a/app/views/spree/admin/adjustments/_adjustments_table.html.haml b/app/views/spree/admin/adjustments/_adjustments_table.html.haml index 7b916f5aee..cbc7df005b 100644 --- a/app/views/spree/admin/adjustments/_adjustments_table.html.haml +++ b/app/views/spree/admin/adjustments/_adjustments_table.html.haml @@ -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 diff --git a/spec/features/admin/adjustments_spec.rb b/spec/features/admin/adjustments_spec.rb index 9d74afd410..2a906824b3 100644 --- a/spec/features/admin/adjustments_spec.rb +++ b/spec/features/admin/adjustments_spec.rb @@ -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