test/reindex_test.rb in searchkick-2.3.0 vs test/reindex_test.rb in searchkick-2.3.1
- old
+ new
@@ -37,9 +37,21 @@
Product.searchkick_index.promote(reindex[:index_name])
assert_search "product", ["Product A"]
end
+ def test_async_non_integer_pk
+ skip if !defined?(ActiveJob)
+
+ Sku.create(id: SecureRandom.hex, name: "Test")
+ reindex = Sku.reindex(async: true)
+ assert_search "sku", [], conversions: false
+
+ index = Searchkick::Index.new(reindex[:index_name])
+ index.refresh
+ assert_equal 1, index.total_docs
+ end
+
def test_refresh_interval
reindex = Product.reindex(refresh_interval: "30s", async: true, import: false)
index = Searchkick::Index.new(reindex[:index_name])
assert_nil Product.search_index.refresh_interval
assert_equal "30s", index.refresh_interval