test/highlight_test.rb in searchkick-2.1.1 vs test/highlight_test.rb in searchkick-2.2.0
- old
+ new
@@ -44,9 +44,14 @@
def test_encoder
store_names ["<b>Hello</b>"]
assert_equal "<b><em>Hello</em></b>", Product.search("hello", fields: [:name], highlight: {encoder: "html"}, misspellings: false).first.search_highlights[:name]
end
+ def test_word_middle
+ store_names ["Two Door Cinema Club"]
+ assert_equal "Two Door <em>Cinema</em> Club", Product.search("ine", fields: [:name], match: :word_middle, highlight: true).first.search_highlights[:name]
+ end
+
def test_body
skip if ENV["MATCH"] == "word_start"
store_names ["Two Door Cinema Club"]
body = {
query: {