Sha256: 34bd54ed6cddb7cb1352cc339592b23218ebc2b499104205e1e6e93e7125608d

Contents?: true

Size: 985 Bytes

Versions: 3

Compression:

Stored size: 985 Bytes

Contents

require 'test_helper'

module Workarea
  module Search
    class Storefront
      class ContentTest < Workarea::IntegrationTest
        def test_should_be_indexed
          Workarea.with_config do |config|
            config.exclude_from_content_search_index << 'Workarea::Catalog::Product'
            product = create_product
            content = Workarea::Content.for(product).tap do |c|
              c.blocks.create!(type: :html, data: { 'html' => '<p>foo</p>' })
            end
            product_content_search_model = Content.new(content)
            page = create_page
            content = Workarea::Content.for(page).tap do |c|
              c.blocks.create!(type: :html, data: { 'html' => '<p>foo</p>' })
            end
            page_content_search_model = Content.new(content)

            refute(product_content_search_model.should_be_indexed?)
            assert(page_content_search_model.should_be_indexed?)
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
workarea-content_search-1.1.0 test/models/workarea/search/storefront/content_test.rb
workarea-content_search-1.0.9 test/models/workarea/search/storefront/content_test.rb
workarea-content_search-1.0.8 test/models/workarea/search/storefront/content_test.rb