Sha256: ab5902add8f96a464a7e48828a4d176d153b72cae9cb5b51d7f290f9eaf69de6

Contents?: true

Size: 731 Bytes

Versions: 6

Compression:

Stored size: 731 Bytes

Contents

require_relative "test_helper"

class TestModel < Minitest::Test

  def test_disable_callbacks_model
    store_names ["product a"]

    Product.disable_search_callbacks
    assert !Product.search_callbacks?

    store_names ["product b"]
    assert_search "product", ["product a"]

    Product.enable_search_callbacks
    Product.reindex

    assert_search "product", ["product a", "product b"]
  end

  def test_disable_callbacks_global
    store_names ["product a"]

    Searchkick.disable_callbacks
    assert !Searchkick.callbacks?

    store_names ["product b"]
    assert_search "product", ["product a"]

    Searchkick.enable_callbacks
    Product.reindex

    assert_search "product", ["product a", "product b"]
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
searchkick-0.8.7 test/model_test.rb
searchkick-0.8.6 test/model_test.rb
searchkick-0.8.5 test/model_test.rb
searchkick-0.8.4 test/model_test.rb
searchkick-0.8.3 test/model_test.rb
searchkick-0.8.2 test/model_test.rb