mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-14 23:47:48 +00:00
Enforce RSpec expect(..).not_to over to_not
This commit is contained in:
@@ -35,7 +35,7 @@ module Api
|
||||
expect(response.status).to eq 200
|
||||
expect(json_response["id"]).to eq enterprise.id
|
||||
enterprise.reload
|
||||
expect(enterprise.logo).to_not be_attached
|
||||
expect(enterprise.logo).not_to be_attached
|
||||
end
|
||||
|
||||
context "when logo does not exist" do
|
||||
|
||||
@@ -57,7 +57,7 @@ module Api
|
||||
q: { ransack_param => "Kangaroo" }
|
||||
|
||||
expect(product_ids).to include product1.id
|
||||
expect(product_ids).to_not include product2.id
|
||||
expect(product_ids).not_to include product2.id
|
||||
end
|
||||
|
||||
context "with variant overrides" do
|
||||
@@ -84,7 +84,7 @@ module Api
|
||||
it "does not return products where the variant overrides are out of stock" do
|
||||
api_get :products, id: order_cycle.id, distributor: distributor.id
|
||||
|
||||
expect(product_ids).to_not include product2.id
|
||||
expect(product_ids).not_to include product2.id
|
||||
end
|
||||
end
|
||||
|
||||
@@ -99,7 +99,7 @@ module Api
|
||||
|
||||
expect(response.status).to eq 200
|
||||
expect(product_ids).to eq [product1.id, product2.id]
|
||||
expect(product_ids).to_not include product3.id
|
||||
expect(product_ids).not_to include product3.id
|
||||
end
|
||||
|
||||
context "with supplier properties" do
|
||||
@@ -118,7 +118,7 @@ module Api
|
||||
|
||||
expect(response.status).to eq 200
|
||||
expect(product_ids).to match_array [product1.id, product2.id]
|
||||
expect(product_ids).to_not include product3.id
|
||||
expect(product_ids).not_to include product3.id
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -129,7 +129,7 @@ module Api
|
||||
q: { primary_taxon_id_in_any: [taxon2.id] }
|
||||
|
||||
expect(product_ids).to include product2.id, product3.id
|
||||
expect(product_ids).to_not include product1.id, product4.id
|
||||
expect(product_ids).not_to include product1.id, product4.id
|
||||
end
|
||||
end
|
||||
|
||||
@@ -176,7 +176,7 @@ module Api
|
||||
|
||||
api_get :products, id: order_cycle.id, distributor: distributor.id
|
||||
|
||||
expect(product_ids).to_not include product1.id
|
||||
expect(product_ids).not_to include product1.id
|
||||
end
|
||||
|
||||
it "does not return variants hidden for this specific customer" do
|
||||
@@ -185,7 +185,7 @@ module Api
|
||||
|
||||
api_get :products, id: order_cycle.id, distributor: distributor.id
|
||||
|
||||
expect(product_ids).to_not include product2.id
|
||||
expect(product_ids).not_to include product2.id
|
||||
end
|
||||
|
||||
it "returns hidden variants made visible for this specific customer" do
|
||||
@@ -197,7 +197,7 @@ module Api
|
||||
|
||||
api_get :products, id: order_cycle.id, distributor: distributor.id
|
||||
|
||||
expect(product_ids).to_not include product1.id
|
||||
expect(product_ids).not_to include product1.id
|
||||
expect(product_ids).to include product3.id
|
||||
end
|
||||
end
|
||||
|
||||
@@ -35,7 +35,7 @@ module Api
|
||||
expect(response.status).to eq 200
|
||||
expect(json_response["id"]).to eq enterprise.id
|
||||
enterprise.reload
|
||||
expect(enterprise.promo_image).to_not be_attached
|
||||
expect(enterprise.promo_image).not_to be_attached
|
||||
end
|
||||
|
||||
context "when promo image does not exist" do
|
||||
|
||||
@@ -194,14 +194,14 @@ describe Api::V0::ShipmentsController, type: :controller do
|
||||
expect {
|
||||
api_put :add, params.merge(variant_id: existing_variant.to_param)
|
||||
expect(response.status).to eq(422)
|
||||
}.to_not change { existing_variant.reload.on_hand }
|
||||
}.not_to change { existing_variant.reload.on_hand }
|
||||
end
|
||||
|
||||
it "doesn't adjust stock when removing a variant" do
|
||||
expect {
|
||||
api_put :remove, params.merge(variant_id: existing_variant.to_param)
|
||||
expect(response.status).to eq(422)
|
||||
}.to_not change { existing_variant.reload.on_hand }
|
||||
}.not_to change { existing_variant.reload.on_hand }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ module Api
|
||||
expect(response.status).to eq 200
|
||||
expect(json_response["id"]).to eq enterprise.id
|
||||
enterprise.reload
|
||||
expect(enterprise.terms_and_conditions).to_not be_attached
|
||||
expect(enterprise.terms_and_conditions).not_to be_attached
|
||||
end
|
||||
|
||||
context "when terms and conditions file does not exist" do
|
||||
|
||||
@@ -172,7 +172,7 @@ describe Api::V0::VariantsController, type: :controller do
|
||||
variant = product.variants.first
|
||||
spree_delete :destroy, id: variant.to_param
|
||||
|
||||
expect(variant.reload).to_not be_deleted
|
||||
expect(variant.reload).not_to be_deleted
|
||||
expect(assigns(:variant).errors[:product]).to include "must have at least one variant"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user