Sha256: 5d136596726427f9c05c1c7a40786877c2ac09a67353234cab70c7a4a2653cbc

Contents?: true

Size: 622 Bytes

Versions: 62

Compression:

Stored size: 622 Bytes

Contents

require 'test_helper'

module Workarea
  class CleanRangeFacetsTest < TestCase
    def test_result
      cleaner = CleanRangeFacets.new(
        'price' => [
          { 'from' => '', 'to' => '9.99' },
          { 'from' => '10', 'to' => '' }
        ]
      )

      assert_equal(
        { 'price' => [{ 'to' => 9.99 }, { 'from' => 10 }] },
        cleaner.result
      )

      cleaner = CleanRangeFacets.new(
        'price' => [
          { 'from' => '', 'to' => '' },
          { 'from' => '10', 'to' => '' }
        ]
      )

      assert_equal({ 'price' => [{ 'from' => 10 }] }, cleaner.result)
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.26 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.45 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.25 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.23 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.44 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.22 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.43 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.21 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.42 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.20 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.41 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.19 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.40 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.18 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.39 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.17 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.38 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.16 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.37 test/services/workarea/clean_range_facets_test.rb