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.15 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.36 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.14 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.35 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.13 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.34 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.12 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.33 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.11 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.10 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.32 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.9 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.31 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.8 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.30 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.7 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.29 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.6 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.4.28 test/services/workarea/clean_range_facets_test.rb
workarea-core-3.5.5 test/services/workarea/clean_range_facets_test.rb