Fix test failure due to hash interpreted as block in matcher

Wrap hash in parentheses to ensure it's passed as an argument rather than a block.
This commit is contained in:
Carlos Chitty
2025-04-29 15:05:52 -04:00
parent 63168086e7
commit 446be6e127

View File

@@ -68,7 +68,7 @@ RSpec.describe Admin::InventoryItemsController, type: :controller do
it "returns an error message" do
expect{ spree_post :create, bad_params }.to change{ InventoryItem.count }.by(0)
expect(response.body).to eq { :errors => ["Visible must be true or false"] }.to_json
expect(response.body).to eq({ errors: ["Visible must be true or false"] }.to_json)
end
end
end
@@ -134,7 +134,7 @@ RSpec.describe Admin::InventoryItemsController, type: :controller do
it "returns an error message" do
expect{ spree_put :update, bad_params }.to change{ InventoryItem.count }.by(0)
expect(response.body).to eq { :errors => ["Visible must be true or false"] }.to_json
expect(response.body).to eq({ errors: ["Visible must be true or false"] }.to_json)
end
end
end