mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
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:
@@ -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 } }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user