Sha256: 415402968705cf797397924664b6b15ac17a16eaa923076663a68dc20a8fa765

Contents?: true

Size: 1.26 KB

Versions: 28

Compression:

Stored size: 1.26 KB

Contents

require 'test_helper'

module Workarea
  module AssetEndpoints
    class FaviconsTest < TestCase
      def test_result
        Workarea.config.favicon_allowed_sizes = %w(32x32 16x16)

        endpoint = Favicons.new({ size: '32x32' }, nil, {})
        assert_includes(endpoint.result.url, Workarea.config.favicon_placeholder_image_name)

        default_asset = create_asset(tag_list: 'favicon')
        assert_equal(default_asset.favicon('32x32').url, endpoint.result.url)

        asset_32 = create_asset(tag_list: 'favicon-32x32')
        assert_equal(asset_32.favicon('32x32').url, endpoint.result.url)

        endpoint = Favicons.new({ size: '16x16' }, nil, {})
        assert_equal(default_asset.favicon('16x16').url, endpoint.result.url)

        endpoint = Favicons.new({ size: '64x64' }, nil, {})
        assert_nil(endpoint.result)
      end

      def test_ico
        endpoint = Favicons.new({}, nil, {})
        assert_includes(endpoint.ico.url, Workarea.config.favicon_placeholder_image_name)

        default_asset = create_asset(tag_list: 'favicon')
        assert_equal(default_asset.favicon_ico.url, endpoint.ico.url)

        asset_ico = create_asset(tag_list: 'favicon-ico')
        assert_equal(asset_ico.favicon_ico.url, endpoint.ico.url)
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

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