Sha256: b8c2d72724acc7829da381657a5763b43cd84701f6aebe4e72e7349aa45eb357

Contents?: true

Size: 743 Bytes

Versions: 21

Compression:

Stored size: 743 Bytes

Contents

require_relative "test_helper"

class TestShouldIndex < Minitest::Unit::TestCase

  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

21 entries across 21 versions & 1 rubygems

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