Sha256: b2420940f5fbbf11930f9f5b65d2860d574a1ea8c9c093388bbad8dc7aa5e0dc

Contents?: true

Size: 708 Bytes

Versions: 2

Compression:

Stored size: 708 Bytes

Contents

require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'

class SpecialContentTest < ActiveSupport::TestCase
  include Ferret::Index
  include Ferret::Search

  def setup
    ContentBase.rebuild_index
    Comment.rebuild_index
  end
  
  def test_class_index_dir
    assert SpecialContent.aaf_configuration[:index_dir] =~ %r{^./index/test/content_base}
  end

  def test_find_with_ferret
    contents_from_ferret = SpecialContent.find_with_ferret('single table')
    assert_equal 1, contents_from_ferret.size
    assert_equal ContentBase.find(3), contents_from_ferret.first
    contents_from_ferret = SpecialContent.find_with_ferret('title')
    assert contents_from_ferret.empty?
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_ferret-0.5.4 doc/demo/test/unit/special_content_test.rb
acts_as_ferret-0.5.3 doc/demo/test/unit/special_content_test.rb