Commit 7a60ebe0b943c7bfbb3c8ed27f1db2a60fafeb14
1 parent
2b3d5259
Exists in
master
and in
1 other branch
Added test for updating missing document
Showing
1 changed file
with
11 additions
and
0 deletions
Show diff stats
test/partial_reindex_test.rb
... | ... | @@ -60,4 +60,15 @@ class PartialReindexTest < Minitest::Test |
60 | 60 | product = Product.create!(name: "Hi") |
61 | 61 | product.reindex(:search_data, mode: :async) |
62 | 62 | end |
63 | + | |
64 | + def test_missing | |
65 | + store [{name: "Hi", color: "Blue"}] | |
66 | + | |
67 | + product = Product.first | |
68 | + Product.search_index.remove(product) | |
69 | + error = assert_raises(Searchkick::ImportError) do | |
70 | + product.reindex(:search_name) | |
71 | + end | |
72 | + assert_match "document missing", error.message | |
73 | + end | |
63 | 74 | end | ... | ... |