Sha256: 2f500c9fc95dd34afd801589e8c772fe6a3a83b7cb91500e3eb27281defb5aa1

Contents?: true

Size: 731 Bytes

Versions: 51

Compression:

Stored size: 731 Bytes

Contents

require_relative "test_helper"

class ShouldIndexTest < Minitest::Test
  def test_basic
    store_names ["INDEX", "DO NOT INDEX"]
    assert_search "index", ["INDEX"]
  end

  def test_default_true
    assert Animal.new.should_index?
  end

  def test_change_to_true
    store_names ["DO NOT INDEX"]
    assert_search "index", []
    product = Product.first
    product.name = "INDEX"
    product.save!
    Product.searchkick_index.refresh
    assert_search "index", ["INDEX"]
  end

  def test_change_to_false
    store_names ["INDEX"]
    assert_search "index", ["INDEX"]
    product = Product.first
    product.name = "DO NOT INDEX"
    product.save!
    Product.searchkick_index.refresh
    assert_search "index", []
  end
end

Version data entries

51 entries across 51 versions & 4 rubygems

Version Path
searchkick-3.1.0 test/should_index_test.rb
searchkick-3.0.3 test/should_index_test.rb
searchkick_evichat-0.0.2 test/should_index_test.rb
searchkick-3.0.2 test/should_index_test.rb
searchkick-3.0.1 test/should_index_test.rb
searchkick-3.0.0 test/should_index_test.rb
searchkick-2.5.0 test/should_index_test.rb
searchkick-hooopo-2.4.1 test/should_index_test.rb
searchkick-hooopo-2.4.0 test/should_index_test.rb
searchkick-2.4.0 test/should_index_test.rb
searchkick-hooopo-2.3.5 test/should_index_test.rb
searchkick-2.3.2 test/should_index_test.rb
searchkick-hooopo-2.3.4 test/should_index_test.rb
searchkick-2.3.1 test/should_index_test.rb
searchkick-hooopo-2.3.3 test/should_index_test.rb
searchkick-hooopo-2.3.2 test/should_index_test.rb
searchkick-hooopo-2.3.1 test/should_index_test.rb
searchkick-hooopo-2.3.0 test/should_index_test.rb
searchkick-2.3.0 test/should_index_test.rb
searchkick-2.2.1 test/should_index_test.rb