Commit 4a7739dede3bee455c76db5e1a8df8fdd7925a5c

Authored by Andrew Kane
1 parent 3816fd74

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 18 old_index.create
19 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 24 assert different_index.exists?
25 25 assert !old_index.exists?
26 26 end
... ... @@ -30,21 +30,21 @@ class IndexTest < Minitest::Test
30 30 old_index = Searchkick::Index.new("products_test#{suffix}_20130801000000")
31 31 old_index.create
32 32  
33   - Product.searchkick_index.clean_indices
  33 + Product.search_index.clean_indices
34 34  
35 35 assert !old_index.exists?
36 36 end
37 37  
38 38 def test_retain
39 39 Product.reindex
40   - assert_equal 1, Product.searchkick_index.all_indices.size
  40 + assert_equal 1, Product.search_index.all_indices.size
41 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 43 end
44 44  
45 45 def test_total_docs
46 46 store_names ["Product A"]
47   - assert_equal 1, Product.searchkick_index.total_docs
  47 + assert_equal 1, Product.search_index.total_docs
48 48 end
49 49  
50 50 def test_mappings
... ... @@ -56,16 +56,16 @@ class IndexTest < Minitest::Test
56 56 end
57 57  
58 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 60 end
61 61  
62 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 64 end
65 65  
66 66 def test_remove_blank_id
67 67 store_names ["Product A"]
68   - Product.searchkick_index.remove(Product.new)
  68 + Product.search_index.remove(Product.new)
69 69 assert_search "product", ["Product A"]
70 70 ensure
71 71 Product.reindex
... ...