test/match_test.rb in searchkick-2.3.2 vs test/match_test.rb in searchkick-2.4.0
- old
+ new
@@ -16,10 +16,17 @@
def test_cheese_space_in_index
store_names ["Pepper Jack Cheese Skewers"]
assert_search "pepperjack cheese skewers", ["Pepper Jack Cheese Skewers"]
end
+ def test_operator
+ store_names ["fresh", "honey"]
+ assert_search "fresh honey", ["fresh", "honey"], {operator: "or"}
+ assert_search "fresh honey", [], {operator: "and"}
+ assert_search "fresh honey", ["fresh", "honey"], {operator: :or}
+ end
+
# def test_cheese_space_in_query
# store_names ["Pepperjack Cheese Skewers"]
# assert_search "pepper jack cheese skewers", ["Pepperjack Cheese Skewers"]
# end
@@ -234,9 +241,14 @@
end
def test_phrase
store_names ["Fresh Honey", "Honey Fresh"]
assert_search "fresh honey", ["Fresh Honey"], match: :phrase
+ end
+
+ def test_phrase_again
+ store_names ["Social entrepreneurs don't have it easy raising capital"]
+ assert_search "social entrepreneurs don't have it easy raising capital", ["Social entrepreneurs don't have it easy raising capital"], match: :phrase
end
def test_phrase_order
store_names ["Wheat Bread", "Whole Wheat Bread"]
assert_order "wheat bread", ["Wheat Bread", "Whole Wheat Bread"], match: :phrase