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

Changeset 160

Show
Ignore:
Timestamp:
03/09/07 09:38:37 (2 years ago)
Author:
jk
Message:

highlight test

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/demo/test/unit/content_test.rb

    r157 r160  
    4444    assert_equal 1, highlight.size 
    4545    assert_equal "this is not the <em>title</em>", highlight.first 
     46 
     47    highlight = @another_content.highlight('title', :field => :description) 
     48    assert_equal 1, highlight.size 
     49    assert_equal "this is not the <em>title</em>", highlight.first 
     50  end 
     51 
     52  def test_highlight_new_record 
     53    c = Content.create :title => 'the title', :description => 'the new description' 
     54    highlight = c.highlight('new') 
     55    assert_equal 1, highlight.size 
     56    assert_equal "the <em>new</em> description", highlight.first 
     57 
     58    c1 = Content.find_by_contents('new description').first 
     59    assert_equal c, c1 
     60    highlight = c1.highlight('new') 
     61    assert_equal 1, highlight.size 
     62    assert_equal "the <em>new</em> description", highlight.first 
    4663  end 
    4764 

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