Sha256: 3a9bf9fdf837dae833e5c8b54fb5fc4bbb94dbcf250987228fb13d2c8f6b3004

Contents?: true

Size: 1.57 KB

Versions: 28

Compression:

Stored size: 1.57 KB

Contents

require 'test_helper'

module Workarea
  module Search
    class Admin
      class ContentAssetTest < TestCase
        def test_search_text
          asset = create_asset(
            name: 'Foo',
            file_name: 'bar.txt',
            tag_list: 'one, two, three'
          )

          result = ContentAsset.new(asset).search_text

          assert_includes(result, 'Foo')
          assert_includes(result, 'bar.txt')
          assert_includes(result, 'one, two, three')
        end

        def test_placeholders
          Workarea.config.image_placeholder_image_name = 'foo.jpg'
          Workarea.config.open_graph_placeholder_image_name = 'bar.jpg'
          Workarea.config.favicon_placeholder_image_name = 'baz.jpg'

          image_placeholder = create_asset(
            name: 'Image',
            file_name: Workarea.config.image_placeholder_image_name,
          )

          open_graph_placeholder = create_asset(
            name: 'Open Graph',
            file_name: Workarea.config.open_graph_placeholder_image_name,
          )

          favicon_placeholder = create_asset(
            name: 'Favicon',
            file_name: Workarea.config.favicon_placeholder_image_name
          )

          image_result = ContentAsset.new(image_placeholder)
          open_graph_result = ContentAsset.new(open_graph_placeholder)
          favicon_result = ContentAsset.new(favicon_placeholder)

          refute(image_result.should_be_indexed?)
          refute(open_graph_result.should_be_indexed?)
          refute(favicon_result.should_be_indexed?)
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.26 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.25 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.23 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.22 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.21 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.20 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.19 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.18 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.17 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.16 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.15 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.14 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.13 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.12 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.11 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.10 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.9 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.8 test/models/workarea/search/admin/content_asset_test.rb
workarea-core-3.5.7 test/models/workarea/search/admin/content_asset_test.rb