diff --git a/test/routing_test.rb b/test/routing_test.rb index c6f2e91..9484165 100644 --- a/test/routing_test.rb +++ b/test/routing_test.rb @@ -1,12 +1,12 @@ require_relative "test_helper" class RoutingTest < Minitest::Test - def test_routing_query + def test_query query = Store.search("Dollar Tree", routing: "Dollar Tree", execute: false) assert_equal query.params[:routing], "Dollar Tree" end - def test_routing_mappings + def test_mappings mappings = Store.searchkick_index.index_options[:mappings] if Searchkick.server_below?("7.0.0") mappings = mappings[:store] @@ -14,24 +14,24 @@ class RoutingTest < Minitest::Test assert_equal mappings[:_routing], required: true end - def test_routing_correct_node + def test_correct_node store_names ["Dollar Tree"], Store assert_search "*", ["Dollar Tree"], {routing: "Dollar Tree"}, Store end - def test_routing_incorrect_node + def test_incorrect_node store_names ["Dollar Tree"], Store assert_search "*", ["Dollar Tree"], {routing: "Boom"}, Store end - def test_routing_async + def test_async with_options({routing: true, callbacks: :async}, Song) do store_names ["Dollar Tree"], Song Song.destroy_all end end - def test_routing_queue + def test_queue with_options({routing: true, callbacks: :queue}, Song) do store_names ["Dollar Tree"], Song Song.destroy_all diff --git a/test/scroll_test.rb b/test/scroll_test.rb index 4d43091..8c3ff77 100644 --- a/test/scroll_test.rb +++ b/test/scroll_test.rb @@ -1,7 +1,7 @@ require_relative "test_helper" class ScrollTest < Minitest::Test - def test_scroll + def test_works store_names ["Product A", "Product B", "Product C", "Product D", "Product E", "Product F"] products = Product.search("product", order: {name: :asc}, scroll: '1m', per_page: 2) assert_equal ["Product A", "Product B"], products.map(&:name) @@ -25,7 +25,7 @@ class ScrollTest < Minitest::Test assert_equal [], products.map(&:name) end - def test_scroll_body + def test_body store_names ["Product A", "Product B", "Product C", "Product D", "Product E", "Product F"] products = Product.search("product", body: {query: {match_all: {}}, sort: [{name: "asc"}]}, scroll: '1m', per_page: 2) assert_equal ["Product A", "Product B"], products.map(&:name) @@ -49,12 +49,12 @@ class ScrollTest < Minitest::Test assert_equal [], products.map(&:name) end - def test_scroll_all + def test_all store_names ["Product A"] assert_equal ["Product A"], Product.search("*", scroll: "1m").map(&:name) end - def test_scroll_no_option + def test_no_option products = Product.search("*") error = assert_raises Searchkick::Error do products.scroll @@ -62,7 +62,7 @@ class ScrollTest < Minitest::Test assert_match /Pass .+ option/, error.message end - def test_scroll_block + def test_block store_names ["Product A", "Product B", "Product C", "Product D", "Product E", "Product F"] batches_count = 0 Product.search("*", scroll: "1m", per_page: 2).scroll do |batch| -- libgit2 0.21.0