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