test/index_test.rb in searchkick-2.3.1 vs test/index_test.rb in searchkick-2.3.2

- old
+ new

@@ -57,10 +57,14 @@ store_names ["Dollar Tree"], Store assert_equal [], Store.search(body: {query: {match: {name: "dollar"}}}).map(&:name) assert_equal ["Dollar Tree"], Store.search(body: {query: {match: {name: "Dollar Tree"}}}, load: false).map(&:name) end + def test_body_warning + assert_output(nil, "The body option replaces the entire body, so the following options are ignored: where\n") { Store.search(body: {query: {match: {name: "dollar"}}}, where: {id: 1}) } + end + def test_block store_names ["Dollar Tree"] products = Product.search "boom" do |body| body[:query] = {match_all: {}} @@ -141,10 +145,14 @@ skip if nobrainer? large_value = 1000.times.map { "hello" }.join(" ") store [{name: "Product A", text: large_value}], Region assert_search "product", ["Product A"], {}, Region assert_search "hello", ["Product A"], {fields: [:name, :text]}, Region - assert_search "hello", ["Product A"], {}, Region + + # needs fields for ES 6 + if elasticsearch_below60? + assert_search "hello", ["Product A"], {}, Region + end end def test_very_large_value skip if nobrainer? || elasticsearch_below22? large_value = 10000.times.map { "hello" }.join(" ")