Sha256: 0db0a8ce00dded8a8dbede7be5068b26cfa760d7aaba41a1153d538a6861aa54

Contents?: true

Size: 752 Bytes

Versions: 34

Compression:

Stored size: 752 Bytes

Contents

require 'test_helper'

module Workarea
  module Search
    class FacetSorting
      class SizeTest < TestCase
        def test_call
          Workarea.with_config do |config|
            config.search_facet_size_sort = %(XS S M L XL)

            results = { 'M' => 50, 'L' => 40, 'S' => 30, 'XL' => 20, 'XS' => 10 }
            assert_equal(
              { 'XS' => 10, 'S' => 30, 'M' => 50, 'L' => 40, 'XL' => 20 },
              Size.call(:size, results)
            )

            results = { 'M' => 50, 'Small' => 40, 'XXL' => 30, 'XL' => 20 }
            assert_equal(
              { 'M' => 50, 'XL' => 20, 'Small' => 40, 'XXL' => 30 },
              Size.call(:size, results)
            )
          end
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-core-3.4.45 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.44 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.43 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.42 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.41 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.40 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.39 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.38 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.37 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.36 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.35 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.34 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.33 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.32 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.31 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.30 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.29 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.28 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.27 test/queries/workarea/search/facet_sorting/size_test.rb
workarea-core-3.4.26 test/queries/workarea/search/facet_sorting/size_test.rb