Sha256: 7773f49b9097b225b9d7c30a343de82fe30e5ff78be985f7d62631cec7d10034

Contents?: true

Size: 731 Bytes

Versions: 13

Compression:

Stored size: 731 Bytes

Contents

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

class SpecialContentTest < Test::Unit::TestCase
  include Ferret::Index
  include Ferret::Search
  fixtures :contents, :comments

  def setup
    ContentBase.rebuild_index
    Comment.rebuild_index
  end
  
  def test_class_index_dir
    assert SpecialContent.aaf_configuration[:index_dir] =~ %r{^#{RAILS_ROOT}/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

13 entries across 13 versions & 4 rubygems

Version Path
cehoffman-acts_as_ferret-0.4.4 doc/demo/test/unit/special_content_test.rb
jkraemer-acts_as_ferret-0.4.4 doc/demo/test/unit/special_content_test.rb
watson-acts_as_ferret-0.4.8.2 doc/demo/test/unit/special_content_test.rb
acts_as_ferret-0.5.2 doc/demo/test/unit/special_content_test.rb
acts_as_ferret-0.4.8.2 doc/demo/test/unit/special_content_test.rb
acts_as_ferret-0.4.8.1 doc/demo/test/unit/special_content_test.rb
acts_as_ferret-0.5.1 doc/demo/test/unit/special_content_test.rb
acts_as_ferret-0.5 doc/demo/test/unit/special_content_test.rb
acts_as_ferret-0.4.8.rails3 doc/demo/test/unit/special_content_test.rb
acts_as_ferret-0.4.8 doc/demo/test/unit/special_content_test.rb
acts_as_ferret-0.4.7 doc/demo/test/unit/special_content_test.rb
acts_as_ferret-0.4.6 doc/demo/test/unit/special_content_test.rb
acts_as_ferret-0.4.4 doc/demo/test/unit/special_content_test.rb