Delete test in line_items_controller_spec.rb

Rails 4 does not recognise requests to destroy routes without ids as valid routes.

Fixes:

 14) LineItemsController destroying a line item on a completed order without a line item id fails and raises an error
      Failure/Error: delete :destroy

      ActionController::UrlGenerationError:
        No route matches {:action=>"destroy", :controller=>"line_items"}
      # ./spec/controllers/line_items_controller_spec.rb:46:in `block (5 levels) in <top (required)>'
This commit is contained in:
Matt-Yorkley
2020-03-12 12:21:46 +01:00
parent 4ea891ee2f
commit 9a5452cd52

View File

@@ -41,13 +41,6 @@ describe LineItemsController, type: :controller do
before { allow(controller).to receive_messages spree_current_user: item.order.user }
context "without a line item id" do
it "fails and raises an error" do
delete :destroy
expect(response.status).to eq 404
end
end
context "with a line item id" do
let(:params) { { format: :json, id: item } }