Sha256: c67be7375d7bfe9b4c6f7b433d87efccd8ae3f2e65154fe758bcd4f3a0a30f68

Contents?: true

Size: 670 Bytes

Versions: 4

Compression:

Stored size: 670 Bytes

Contents

require_relative "test_helper"

class TestInheritance < Minitest::Unit::TestCase

  def setup
    super
    Animal.destroy_all
  end

  def test_child_reindex
    store_names ["Max"], Cat
    assert Dog.reindex
    Animal.searchkick_index.refresh
    assert_equal 1, Animal.search("*").size
  end

  def test_child_index_name
    assert_equal "animals_test", Dog.searchkick_index.name
  end

  def test_child_search
    store_names ["Bear"], Dog
    store_names ["Bear"], Cat
    assert_equal 1, Dog.search("bear").size
  end

  def test_parent_search
    store_names ["Bear"], Dog
    store_names ["Bear"], Cat
    assert_equal 2, Animal.search("bear").size
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
searchkick-0.3.5 test/inheritance_test.rb
searchkick-0.3.4 test/inheritance_test.rb
searchkick-0.3.3 test/inheritance_test.rb
searchkick-0.3.2 test/inheritance_test.rb