Sha256: b5232c40ee6f6f34396f09198442bc8d8ad7e89bee7c841d0996d6dced122992

Contents?: true

Size: 729 Bytes

Versions: 23

Compression:

Stored size: 729 Bytes

Contents

require_relative "test_helper"

class ReindexJobTest < Minitest::Test
  def setup
    super
    Searchkick.disable_callbacks
  end

  def teardown
    Searchkick.enable_callbacks
  end

  def test_create
    product = Product.create!(name: "Boom")
    Product.searchkick_index.refresh
    assert_search "*", []
    Searchkick::ReindexJob.new("Product", product.id.to_s).perform
    Product.searchkick_index.refresh
    assert_search "*", ["Boom"]
  end

  def test_destroy
    product = Product.create!(name: "Boom")
    Product.reindex
    assert_search "*", ["Boom"]
    product.destroy
    Searchkick::ReindexJob.new("Product", product.id.to_s).perform
    Product.searchkick_index.refresh
    assert_search "*", []
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
searchkick-1.5.1 test/reindex_job_test.rb
searchkick-1.5.0 test/reindex_job_test.rb
searchkick-1.4.2 test/reindex_job_test.rb
searchkick-1.4.1 test/reindex_job_test.rb
searchkick-1.4.0 test/reindex_job_test.rb
searchkick-1.3.6 test/reindex_job_test.rb
searchkick-1.3.5 test/reindex_job_test.rb
searchkick-1.3.4 test/reindex_job_test.rb
searchkick-1.3.3 test/reindex_job_test.rb
searchkick-1.3.2 test/reindex_job_test.rb
searchkick_bharthur-0.0.2 test/reindex_job_test.rb
searchkick_bharthur-0.0.1 test/reindex_job_test.rb
searchkick-1.3.1 test/reindex_job_test.rb
searchkick-1.3.0 test/reindex_job_test.rb
searchkick-1.2.1 test/reindex_job_test.rb
searchkick-1.2.0 test/reindex_job_test.rb
searchkick-1.1.2 test/reindex_job_test.rb
searchkick-1.1.1 test/reindex_job_test.rb
searchkick-1.1.0 test/reindex_job_test.rb
searchkick-1.0.3 test/reindex_job_test.rb