test/highlight_test.rb in searchkick-1.1.2 vs test/highlight_test.rb in searchkick-1.2.0
- old
+ new
@@ -34,9 +34,14 @@
def test_multiple_words
store_names ["Hello World Hello"]
assert_equal "<em>Hello</em> World <em>Hello</em>", Product.search("hello", fields: [:name], highlight: true).with_details.first[1][:highlight][:name]
end
+ 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).with_details.first[1][:highlight][:name]
+ end
+
def test_json
skip if ENV["MATCH"] == "word_start"
store_names ["Two Door Cinema Club"]
json = {
query: {