Sha256: d2500d1a308510f47dcf4e258dd285bfb86d020e71959ee041327371d687caf5

Contents?: true

Size: 733 Bytes

Versions: 9

Compression:

Stored size: 733 Bytes

Contents

require_relative "test_helper"

class TestShouldIndex < 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

9 entries across 9 versions & 2 rubygems

Version Path
searchkick-0.9.1 test/should_index_test.rb
searchkick-sinneduy-0.9.0 test/should_index_test.rb
searchkick-0.9.0 test/should_index_test.rb
searchkick-0.8.7 test/should_index_test.rb
searchkick-0.8.6 test/should_index_test.rb
searchkick-0.8.5 test/should_index_test.rb
searchkick-0.8.4 test/should_index_test.rb
searchkick-0.8.3 test/should_index_test.rb
searchkick-0.8.2 test/should_index_test.rb