Commit b30c600a8aa9ddee153af20b08994325e787d12c
1 parent
a5dfd102
Exists in
master
and in
5 other branches
Updated test names [skip ci]
Showing
2 changed files
with
11 additions
and
11 deletions
Show diff stats
test/routing_test.rb
1 | 1 | require_relative "test_helper" |
2 | 2 | |
3 | 3 | class RoutingTest < Minitest::Test |
4 | - def test_routing_query | |
4 | + def test_query | |
5 | 5 | query = Store.search("Dollar Tree", routing: "Dollar Tree", execute: false) |
6 | 6 | assert_equal query.params[:routing], "Dollar Tree" |
7 | 7 | end |
8 | 8 | |
9 | - def test_routing_mappings | |
9 | + def test_mappings | |
10 | 10 | mappings = Store.searchkick_index.index_options[:mappings] |
11 | 11 | if Searchkick.server_below?("7.0.0") |
12 | 12 | mappings = mappings[:store] |
... | ... | @@ -14,24 +14,24 @@ class RoutingTest < Minitest::Test |
14 | 14 | assert_equal mappings[:_routing], required: true |
15 | 15 | end |
16 | 16 | |
17 | - def test_routing_correct_node | |
17 | + def test_correct_node | |
18 | 18 | store_names ["Dollar Tree"], Store |
19 | 19 | assert_search "*", ["Dollar Tree"], {routing: "Dollar Tree"}, Store |
20 | 20 | end |
21 | 21 | |
22 | - def test_routing_incorrect_node | |
22 | + def test_incorrect_node | |
23 | 23 | store_names ["Dollar Tree"], Store |
24 | 24 | assert_search "*", ["Dollar Tree"], {routing: "Boom"}, Store |
25 | 25 | end |
26 | 26 | |
27 | - def test_routing_async | |
27 | + def test_async | |
28 | 28 | with_options({routing: true, callbacks: :async}, Song) do |
29 | 29 | store_names ["Dollar Tree"], Song |
30 | 30 | Song.destroy_all |
31 | 31 | end |
32 | 32 | end |
33 | 33 | |
34 | - def test_routing_queue | |
34 | + def test_queue | |
35 | 35 | with_options({routing: true, callbacks: :queue}, Song) do |
36 | 36 | store_names ["Dollar Tree"], Song |
37 | 37 | Song.destroy_all | ... | ... |
test/scroll_test.rb
1 | 1 | require_relative "test_helper" |
2 | 2 | |
3 | 3 | class ScrollTest < Minitest::Test |
4 | - def test_scroll | |
4 | + def test_works | |
5 | 5 | store_names ["Product A", "Product B", "Product C", "Product D", "Product E", "Product F"] |
6 | 6 | products = Product.search("product", order: {name: :asc}, scroll: '1m', per_page: 2) |
7 | 7 | assert_equal ["Product A", "Product B"], products.map(&:name) |
... | ... | @@ -25,7 +25,7 @@ class ScrollTest < Minitest::Test |
25 | 25 | assert_equal [], products.map(&:name) |
26 | 26 | end |
27 | 27 | |
28 | - def test_scroll_body | |
28 | + def test_body | |
29 | 29 | store_names ["Product A", "Product B", "Product C", "Product D", "Product E", "Product F"] |
30 | 30 | products = Product.search("product", body: {query: {match_all: {}}, sort: [{name: "asc"}]}, scroll: '1m', per_page: 2) |
31 | 31 | assert_equal ["Product A", "Product B"], products.map(&:name) |
... | ... | @@ -49,12 +49,12 @@ class ScrollTest < Minitest::Test |
49 | 49 | assert_equal [], products.map(&:name) |
50 | 50 | end |
51 | 51 | |
52 | - def test_scroll_all | |
52 | + def test_all | |
53 | 53 | store_names ["Product A"] |
54 | 54 | assert_equal ["Product A"], Product.search("*", scroll: "1m").map(&:name) |
55 | 55 | end |
56 | 56 | |
57 | - def test_scroll_no_option | |
57 | + def test_no_option | |
58 | 58 | products = Product.search("*") |
59 | 59 | error = assert_raises Searchkick::Error do |
60 | 60 | products.scroll |
... | ... | @@ -62,7 +62,7 @@ class ScrollTest < Minitest::Test |
62 | 62 | assert_match /Pass .+ option/, error.message |
63 | 63 | end |
64 | 64 | |
65 | - def test_scroll_block | |
65 | + def test_block | |
66 | 66 | store_names ["Product A", "Product B", "Product C", "Product D", "Product E", "Product F"] |
67 | 67 | batches_count = 0 |
68 | 68 | Product.search("*", scroll: "1m", per_page: 2).scroll do |batch| | ... | ... |