Commit e20575a4aabacf405e4dfa88fd914e5f81802476
1 parent
734e0c1b
Exists in
master
and in
21 other branches
Added test for dangerous reindex with associations
Showing
2 changed files
with
6 additions
and
0 deletions
Show diff stats
test/index_test.rb
... | ... | @@ -107,6 +107,11 @@ class IndexTest < Minitest::Test |
107 | 107 | assert_raises(Searchkick::DangerousOperation) { Product.where(id: [1, 2, 3]).reindex } |
108 | 108 | end |
109 | 109 | |
110 | + def test_dangerous_index_associations | |
111 | + Store.create!(name: "Test") | |
112 | + assert_raises(Searchkick::DangerousOperation) { Store.first.products.reindex } | |
113 | + end | |
114 | + | |
110 | 115 | def test_dangerous_reindex_accepted |
111 | 116 | store_names ["Product A", "Product B"] |
112 | 117 | Product.where(name: "Product A").reindex(accept_danger: true) | ... | ... |