Sha256: d8ecc38f219d253dcf8761c933043efe17fe9d17fed09db71b8e231f35abe951
Contents?: true
Size: 673 Bytes
Versions: 62
Compression:
Stored size: 673 Bytes
Contents
require 'test_helper' module Workarea class CopyProductTest < TestCase def test_perform product = create_product( id: 'FOOBAR', name: 'Foo Bar Product', slug: 'foobar', variants: [{ sku: 'SKU1' }] ) copy = CopyProduct.new(product, id: 'FOOBAZ').perform assert(copy.persisted?) assert_equal('Foo Bar Product', copy.name) assert_equal('SKU1', copy.variants.first.sku) assert_equal('FOOBAZ', copy.id) assert_equal('foo-bar-product', copy.slug) copy = CopyProduct.new(product, id: 'FOOBAZ').perform refute(copy.persisted?) assert(copy.errors.present?) end end end
Version data entries
62 entries across 62 versions & 1 rubygems