Sha256: ee8d779e8c752e1f52580f54626abf2c0dbae412080829eadbc9035f44c34104

Contents?: true

Size: 754 Bytes

Versions: 62

Compression:

Stored size: 754 Bytes

Contents

require 'test_helper'

module Workarea
  class IndexCategorizationTest < TestCase
    include TestCase::SearchIndexing

    def test_product_not_in_category_after_removal_of_all_rules
      product = create_product(name: 'Categorize This')
      category = create_category(
        product_rules: [
          { name: 'search', operator: 'equals', value: 'Categorize' }
        ]
      )
      IndexCategorization.perform(category)
      categories = Categorization.new(product).to_models

      assert_includes(categories, category)
      assert(category.product_rules.destroy_all)

      IndexCategorization.perform(category.reload)
      categories = Categorization.new(product).to_models

      refute_includes(categories, category)
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/workers/workarea/index_categorization_test.rb
workarea-core-3.5.26 test/workers/workarea/index_categorization_test.rb
workarea-core-3.4.45 test/workers/workarea/index_categorization_test.rb
workarea-core-3.5.25 test/workers/workarea/index_categorization_test.rb
workarea-core-3.5.23 test/workers/workarea/index_categorization_test.rb
workarea-core-3.4.44 test/workers/workarea/index_categorization_test.rb
workarea-core-3.5.22 test/workers/workarea/index_categorization_test.rb
workarea-core-3.4.43 test/workers/workarea/index_categorization_test.rb
workarea-core-3.5.21 test/workers/workarea/index_categorization_test.rb
workarea-core-3.4.42 test/workers/workarea/index_categorization_test.rb
workarea-core-3.5.20 test/workers/workarea/index_categorization_test.rb
workarea-core-3.4.41 test/workers/workarea/index_categorization_test.rb
workarea-core-3.5.19 test/workers/workarea/index_categorization_test.rb
workarea-core-3.4.40 test/workers/workarea/index_categorization_test.rb
workarea-core-3.5.18 test/workers/workarea/index_categorization_test.rb
workarea-core-3.4.39 test/workers/workarea/index_categorization_test.rb
workarea-core-3.5.17 test/workers/workarea/index_categorization_test.rb
workarea-core-3.4.38 test/workers/workarea/index_categorization_test.rb
workarea-core-3.5.16 test/workers/workarea/index_categorization_test.rb
workarea-core-3.4.37 test/workers/workarea/index_categorization_test.rb