Commit 4a7739dede3bee455c76db5e1a8df8fdd7925a5c
1 parent
3816fd74
Exists in
master
and in
5 other branches
Use search_index [skip ci]
Showing
1 changed file
with
9 additions
and
9 deletions
Show diff stats
test/index_test.rb
@@ -18,9 +18,9 @@ class IndexTest < Minitest::Test | @@ -18,9 +18,9 @@ class IndexTest < Minitest::Test | ||
18 | old_index.create | 18 | old_index.create |
19 | different_index.create | 19 | different_index.create |
20 | 20 | ||
21 | - Product.searchkick_index.clean_indices | 21 | + Product.search_index.clean_indices |
22 | 22 | ||
23 | - assert Product.searchkick_index.exists? | 23 | + assert Product.search_index.exists? |
24 | assert different_index.exists? | 24 | assert different_index.exists? |
25 | assert !old_index.exists? | 25 | assert !old_index.exists? |
26 | end | 26 | end |
@@ -30,21 +30,21 @@ class IndexTest < Minitest::Test | @@ -30,21 +30,21 @@ class IndexTest < Minitest::Test | ||
30 | old_index = Searchkick::Index.new("products_test#{suffix}_20130801000000") | 30 | old_index = Searchkick::Index.new("products_test#{suffix}_20130801000000") |
31 | old_index.create | 31 | old_index.create |
32 | 32 | ||
33 | - Product.searchkick_index.clean_indices | 33 | + Product.search_index.clean_indices |
34 | 34 | ||
35 | assert !old_index.exists? | 35 | assert !old_index.exists? |
36 | end | 36 | end |
37 | 37 | ||
38 | def test_retain | 38 | def test_retain |
39 | Product.reindex | 39 | Product.reindex |
40 | - assert_equal 1, Product.searchkick_index.all_indices.size | 40 | + assert_equal 1, Product.search_index.all_indices.size |
41 | Product.reindex(retain: true) | 41 | Product.reindex(retain: true) |
42 | - assert_equal 2, Product.searchkick_index.all_indices.size | 42 | + assert_equal 2, Product.search_index.all_indices.size |
43 | end | 43 | end |
44 | 44 | ||
45 | def test_total_docs | 45 | def test_total_docs |
46 | store_names ["Product A"] | 46 | store_names ["Product A"] |
47 | - assert_equal 1, Product.searchkick_index.total_docs | 47 | + assert_equal 1, Product.search_index.total_docs |
48 | end | 48 | end |
49 | 49 | ||
50 | def test_mappings | 50 | def test_mappings |
@@ -56,16 +56,16 @@ class IndexTest < Minitest::Test | @@ -56,16 +56,16 @@ class IndexTest < Minitest::Test | ||
56 | end | 56 | end |
57 | 57 | ||
58 | def test_tokens | 58 | def test_tokens |
59 | - assert_equal ["dollar", "dollartre", "tree"], Product.searchkick_index.tokens("Dollar Tree", analyzer: "searchkick_index") | 59 | + assert_equal ["dollar", "dollartre", "tree"], Product.search_index.tokens("Dollar Tree", analyzer: "search_index") |
60 | end | 60 | end |
61 | 61 | ||
62 | def test_tokens_analyzer | 62 | def test_tokens_analyzer |
63 | - assert_equal ["dollar", "tree"], Product.searchkick_index.tokens("Dollar Tree", analyzer: "searchkick_search2") | 63 | + assert_equal ["dollar", "tree"], Product.search_index.tokens("Dollar Tree", analyzer: "searchkick_search2") |
64 | end | 64 | end |
65 | 65 | ||
66 | def test_remove_blank_id | 66 | def test_remove_blank_id |
67 | store_names ["Product A"] | 67 | store_names ["Product A"] |
68 | - Product.searchkick_index.remove(Product.new) | 68 | + Product.search_index.remove(Product.new) |
69 | assert_search "product", ["Product A"] | 69 | assert_search "product", ["Product A"] |
70 | ensure | 70 | ensure |
71 | Product.reindex | 71 | Product.reindex |