Commit ba4274969f26ff3a6596dce15ca42d221987fb56
1 parent
856b8da3
Exists in
master
and in
21 other branches
Better similarity
Showing
2 changed files
with
7 additions
and
1 deletions
Show diff stats
lib/searchkick/search.rb
test/similar_test.rb
... | ... | @@ -2,6 +2,11 @@ require_relative "test_helper" |
2 | 2 | |
3 | 3 | class TestSimilar < Minitest::Unit::TestCase |
4 | 4 | |
5 | + def test_similar | |
6 | + store_names ["Annie's Naturals Organic Shiitake & Sesame Dressing"] | |
7 | + assert_search "Annie's Naturals Shiitake & Sesame Vinaigrette", ["Annie's Naturals Organic Shiitake & Sesame Dressing"], similar: true | |
8 | + end | |
9 | + | |
5 | 10 | def test_fields |
6 | 11 | store_names ["1% Organic Milk", "2% Organic Milk", "Popcorn"] |
7 | 12 | assert_equal ["2% Organic Milk"], Product.where(name: "1% Organic Milk").first.similar(fields: ["name"]).map(&:name) | ... | ... |