Use #tap to destroy and remove before block

This commit is contained in:
Matt-Yorkley
2020-05-05 09:55:14 +02:00
parent f2cd122ec8
commit a3757992b5

View File

@@ -103,11 +103,7 @@ describe VariantStock do
end
context 'when the variant has been soft-deleted' do
let(:deleted_variant) { create(:variant) }
before do
deleted_variant.destroy
end
let(:deleted_variant) { create(:variant).tap(&:destroy) }
it 'has no stock items' do
expect(deleted_variant.stock_items.count).to eq 0