Sha256: 7729029c2e242895353da099508fc523007b4c65ca8b1f18515f18e948865d3e

Contents?: true

Size: 682 Bytes

Versions: 28

Compression:

Stored size: 682 Bytes

Contents

require 'test_helper'

module Workarea
  module Search
    class FacetSorting
      class SizeTest < TestCase
        def test_call
          Workarea.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

Version data entries

28 entries across 28 versions & 1 rubygems

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