Check destroying order_cycle will delete associated coordinator fees

This commit is contained in:
Jean-Baptiste Bellet
2022-03-03 09:06:38 +01:00
parent 771f7b0393
commit 5fc7d72b09

View File

@@ -401,6 +401,20 @@ module Admin
expect(flash[:error]).to eq I18n.t('admin.order_cycles.destroy_errors.schedule_present')
end
end
describe "when an order cycle has any coordinator_fees", :debug do
let(:enterprise_fee1) { create(:enterprise_fee) }
before do
oc.coordinator_fees << enterprise_fee1
end
it "displays an error message when we attempt to delete it" do
get :destroy, params: { id: oc.id }
expect(OrderCycle.find_by(id: oc.id)).to be nil
expect(response).to redirect_to admin_order_cycles_path
end
end
end
end
end