Sha256: 58cae6dd6f9306329c796e0b5f341871551a0fc65dba32b7e28697f4b7278358

Contents?: true

Size: 475 Bytes

Versions: 4

Compression:

Stored size: 475 Bytes

Contents

require 'test_helper'

class RecordTest < ActiveSupport::TestCase

  setup do
    Indexes.build
  end

  teardown do
    Indexes.destroy
  end

  test 'indexing' do
    shop = Shop.create(name: 'Anderstons')
    product = shop.products.create(name: 'Les Paul', category: 'Gibson')
    product.run_callbacks :commit
    sleep 2

    assert_equal 1, Product.search.count
    product.destroy
    product.run_callbacks :commit
    assert_equal 0, Product.search.count
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
indexes-4.0.0.2 test/record_test.rb
indexes-4.0.0.1 test/record_test.rb
indexes-4.0.0.0 test/record_test.rb
indexes-0.0.1 test/record_test.rb