To edit pages or tickets please login with username/password: aaf/aaf

Changeset 140

Show
Ignore:
Timestamp:
02/03/07 16:27:38 (2 years ago)
Author:
jk
Message:

more refactoring

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/demo/test/functional/content_controller_test.rb

    r5 r140  
    99 
    1010  def setup 
    11     index = Ferret::Index::Index.new( :path => Content.class_index_dir, :create => true       ) 
     11    index = Ferret::Index::Index.new( :path => Content.aaf_configuration[:index_dir], :create => true ) 
    1212    index.flush 
    1313    index.close 
  • trunk/demo/test/unit/comment_test.rb

    r132 r140  
    1414 
    1515  def test_class_index_dir 
    16     assert_equal "#{RAILS_ROOT}/index/test/comment", Comment.class_index_dir 
     16    assert_equal "#{RAILS_ROOT}/index/test/comment", Comment.aaf_configuration[:index_dir] 
    1717  end 
    1818 
     
    3838 
    3939  def test_rebuild_index 
    40     Comment.ferret_index.query_delete('comment') 
     40    Comment.aaf_index.ferret_index.query_delete('comment') 
    4141    comments_from_ferret = Comment.find_by_contents('comment AND fixture') 
    4242    assert comments_from_ferret.empty? 
     
    7575  # tests the custom to_doc method defined in comment.rb 
    7676  def test_custom_to_doc 
    77     top_docs = Comment.ferret_index.search('"from fixture"') 
     77    top_docs = Comment.aaf_index.ferret_index.search('"from fixture"') 
    7878    #top_docs = Comment.ferret_index.search('"comment from fixture"') 
    7979    assert_equal 2, top_docs.total_hits 
    80     doc = Comment.ferret_index.doc(top_docs.hits[0].doc) 
     80    doc = Comment.aaf_index.ferret_index.doc(top_docs.hits[0].doc) 
    8181    # check for the special field added by the custom to_doc method 
    8282    assert_not_nil doc[:added] 
  • trunk/demo/test/unit/content_test.rb

    r135 r140  
    118118                       :description => c ) 
    119119    c1.save 
    120     hits = Content.ferret_index.search('title:"Content item 1"') 
     120    fi = Content.aaf_index.ferret_index 
     121    hits = fi.search('title:"Content item 1"') 
    121122    assert_equal 1, hits.total_hits 
    122123    expected_doc_num = hits.hits.first.doc 
    123     assert_equal c, Content.ferret_index[expected_doc_num][:description] 
     124    assert_equal c, fi[expected_doc_num][:description] 
    124125    doc_num = c1.document_number 
    125126    assert_equal expected_doc_num, doc_num 
    126     assert_equal c, Content.ferret_index[doc_num][:description] 
     127    assert_equal c, fi[doc_num][:description] 
    127128  end 
    128129 
     
    142143 
    143144  def test_class_index_dir 
    144     assert_equal "#{RAILS_ROOT}/index/test/content_base", Content.class_index_dir 
     145    assert_equal "#{RAILS_ROOT}/index/test/content_base", Content.aaf_configuration[:index_dir] 
    145146  end 
    146147   
     
    234235    assert_equal 4, ContentBase.find(:all).size 
    235236     
    236     Content.ferret_index.flush 
     237    Content.aaf_index.ferret_index.flush 
    237238    contents_from_ferret = Content.multi_search('description:title') 
    238239    assert_equal 1, contents_from_ferret.size 
  • trunk/demo/test/unit/special_content_test.rb

    r51 r140  
    1212   
    1313  def test_class_index_dir 
    14     assert_equal "#{RAILS_ROOT}/index/test/content_base", SpecialContent.class_index_dir 
     14    assert_equal "#{RAILS_ROOT}/index/test/content_base", SpecialContent.aaf_configuration[:index_dir] 
    1515  end 
    1616 

To edit pages or tickets please login with username/password: aaf/aaf