Sha256: 9059dbbe4eefe9da08f9367b499d6212b5f4cc11cad945946f5097ad4ff6b93b

Contents?: true

Size: 741 Bytes

Versions: 21

Compression:

Stored size: 741 Bytes

Contents

require_relative "test_helper"

class TestModel < Minitest::Unit::TestCase

  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

21 entries across 21 versions & 1 rubygems

Version Path
searchkick-0.8.1 test/model_test.rb
searchkick-0.8.0 test/model_test.rb
searchkick-0.7.9 test/model_test.rb
searchkick-0.7.8 test/model_test.rb
searchkick-0.7.7 test/model_test.rb
searchkick-0.7.6 test/model_test.rb
searchkick-0.7.5 test/model_test.rb
searchkick-0.7.4 test/model_test.rb
searchkick-0.7.3 test/model_test.rb
searchkick-0.7.2 test/model_test.rb
searchkick-0.7.1 test/model_test.rb
searchkick-0.7.0 test/model_test.rb
searchkick-0.6.3 test/model_test.rb
searchkick-0.6.2 test/model_test.rb
searchkick-0.6.1 test/model_test.rb
searchkick-0.6.0 test/model_test.rb
searchkick-0.5.3 test/model_test.rb
searchkick-0.5.2 test/model_test.rb
searchkick-0.5.1 test/model_test.rb
searchkick-0.5.0 test/model_test.rb