Commit 026baf1a7e936a04cdbbc787cc15efc1cfb2e40a
1 parent
7c839b5f
Exists in
master
and in
8 other branches
Added test for reindexing relation with should_index? - #1424
Showing
1 changed file
with
14 additions
and
0 deletions
Show diff stats
test/reindex_test.rb
... | ... | @@ -55,6 +55,20 @@ class ReindexTest < Minitest::Test |
55 | 55 | assert_search "product", ["Product A", "Product B"] |
56 | 56 | end |
57 | 57 | |
58 | + def test_relation_should_index | |
59 | + skip if nobrainer? || cequel? | |
60 | + | |
61 | + skip "TODO make pass in Searchkick 5" | |
62 | + | |
63 | + store_names ["Product A", "Product B"] | |
64 | + Searchkick.callbacks(false) do | |
65 | + Product.find_by(name: "Product B").update!(name: "DO NOT INDEX") | |
66 | + end | |
67 | + Product.where(name: "DO NOT INDEX").reindex | |
68 | + Product.search_index.refresh | |
69 | + assert_search "product", ["Product A"] | |
70 | + end | |
71 | + | |
58 | 72 | def test_relation_async |
59 | 73 | skip "Not available yet" |
60 | 74 | end | ... | ... |