Sha256: b149f282ee78cef5e6735a622946d282a1972da5cb60e9b04f264a2fb616ab42

Contents?: true

Size: 615 Bytes

Versions: 4

Compression:

Stored size: 615 Bytes

Contents

require 'test_helper'

module Workarea
  class BrowseOptionCategorizationTest < TestCase
    def test_manual
      product = create_product(
        browse_option: 'color',
        variants: [{ sku: 'SKU', details: { 'color' => 'red' } }]
      )
      category_one = create_category(product_ids: [product.id])
      category_two = create_category(
        product_ids: [BrowseOptionIds.build(product.id, 'red')]
      )

      categorization = Categorization.new(product)
      assert(categorization.manual.include?(category_one.id))
      assert(categorization.manual.include?(category_two.id))
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
workarea-browse_option-2.1.9 test/queries/workarea/browse_option_categorization_test.rb
workarea-browse_option-2.1.8 test/queries/workarea/browse_option_categorization_test.rb
workarea-browse_option-2.1.7 test/queries/workarea/browse_option_categorization_test.rb
workarea-browse_option-2.1.6 test/queries/workarea/browse_option_categorization_test.rb