test/index_test.rb in searchkick-1.0.0 vs test/index_test.rb in searchkick-1.0.1
- old
+ new
@@ -105,10 +105,15 @@
unless mongoid2? || nobrainer? || activerecord_below41?
def test_dangerous_reindex
assert_raises(Searchkick::DangerousOperation) { Product.where(id: [1, 2, 3]).reindex }
end
+ def test_dangerous_index_associations
+ Store.create!(name: "Test")
+ assert_raises(Searchkick::DangerousOperation) { Store.first.products.reindex }
+ end
+
def test_dangerous_reindex_accepted
store_names ["Product A", "Product B"]
Product.where(name: "Product A").reindex(accept_danger: true)
assert_search "product", ["Product A"]
end
@@ -122,9 +127,9 @@
def test_transaction
Product.transaction do
store_names ["Product A"]
raise ActiveRecord::Rollback
end
- assert_search "product", [], conversions: false
+ assert_search "product", []
end
end
end