Sha256: 4536585ebd640166acd3ee7a0bbabed4ede455e3d2ebef9ce10435940fa2add4

Contents?: true

Size: 748 Bytes

Versions: 9

Compression:

Stored size: 748 Bytes

Contents

require_relative "test_helper"

class TestSimilar < Minitest::Test

  def test_similar
    store_names ["Annie's Naturals Organic Shiitake & Sesame Dressing"]
    assert_search "Annie's Naturals Shiitake & Sesame Vinaigrette", ["Annie's Naturals Organic Shiitake & Sesame Dressing"], similar: true
  end

  def test_fields
    store_names ["1% Organic Milk", "2% Organic Milk", "Popcorn"]
    assert_equal ["2% Organic Milk"], Product.where(name: "1% Organic Milk").first.similar(fields: ["name"]).map(&:name)
  end

  def test_order
    store_names ["Lucerne Milk Chocolate Fat Free", "Clover Fat Free Milk"]
    assert_order "Lucerne Fat Free Chocolate Milk", ["Lucerne Milk Chocolate Fat Free", "Clover Fat Free Milk"], similar: true
  end

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
searchkick-0.9.1 test/similar_test.rb
searchkick-sinneduy-0.9.0 test/similar_test.rb
searchkick-0.9.0 test/similar_test.rb
searchkick-0.8.7 test/similar_test.rb
searchkick-0.8.6 test/similar_test.rb
searchkick-0.8.5 test/similar_test.rb
searchkick-0.8.4 test/similar_test.rb
searchkick-0.8.3 test/similar_test.rb
searchkick-0.8.2 test/similar_test.rb