Sha256: b4c6751f7c73fcd882a215f63306f9e9ea65260ccc62e3f26ae2ec18d251ade1

Contents?: true

Size: 746 Bytes

Versions: 7

Compression:

Stored size: 746 Bytes

Contents

require_relative "test_helper"

class SimilarTest < 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

7 entries across 7 versions & 1 rubygems

Version Path
searchkick-1.1.2 test/similar_test.rb
searchkick-1.1.1 test/similar_test.rb
searchkick-1.1.0 test/similar_test.rb
searchkick-1.0.3 test/similar_test.rb
searchkick-1.0.2 test/similar_test.rb
searchkick-1.0.1 test/similar_test.rb
searchkick-1.0.0 test/similar_test.rb