test/highlight_test.rb in searchkick-2.0.1 vs test/highlight_test.rb in searchkick-2.0.2
- old
+ new
@@ -9,9 +9,14 @@
def test_tag
store_names ["Two Door Cinema Club"]
assert_equal "Two Door <strong>Cinema</strong> Club", Product.search("cinema", fields: [:name], highlight: {tag: "<strong>"}).first.search_highlights[:name]
end
+ def test_tag_class
+ store_names ["Two Door Cinema Club"]
+ assert_equal "Two Door <strong class='classy'>Cinema</strong> Club", Product.search("cinema", fields: [:name], highlight: {tag: "<strong class='classy'>"}).first.search_highlights[:name]
+ end
+
def test_multiple_fields
store [{name: "Two Door Cinema Club", color: "Cinema Orange"}]
highlights = Product.search("cinema", fields: [:name, :color], highlight: true).first.search_highlights
assert_equal "Two Door <em>Cinema</em> Club", highlights[:name]
assert_equal "<em>Cinema</em> Orange", highlights[:color]