mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Refactor spec
Better to explicitly test for the change, and specify expected values.
This commit is contained in:
@@ -138,12 +138,11 @@ describe Sets::ProductSet do
|
||||
it 'updates product and variant attributes' do
|
||||
collection_hash[0][:sku] = "test_sku"
|
||||
|
||||
product_set.save
|
||||
|
||||
expect(product.reload.variants.first[:sku]).to eq variants_attributes.first[:sku]
|
||||
expect(product.reload.attributes).to include(
|
||||
'sku' => "test_sku"
|
||||
)
|
||||
expect {
|
||||
product_set.save
|
||||
product.reload
|
||||
}.to change { product.sku }.to("test_sku")
|
||||
.and change { product.variants.first.sku }.to("123")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user