Changeset 290
- Timestamp:
- 12/16/07 20:27:53 (10 months ago)
- Files:
-
- trunk/demo/test/unit/content_test.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/demo/test/unit/content_test.rb
r287 r290 497 497 id = Content.find_with_ferret('title').first.id 498 498 r = Content.find_with_ferret('title OR comment', { :multi => Comment, :limit => :all }, 499 { :conditions => ["id != ?", id]})499 { :conditions => { :content => ["id != ?", id] }}) 500 500 assert_equal 59, r.size 501 501 assert_equal 59, r.total_hits 502 502 503 503 r = Content.find_with_ferret('title OR comment', { :multi => Comment, :limit => 20 }, 504 { :conditions => ["id != ?", id]})504 { :conditions => { :content => ["id != ?", id] }}) 505 505 assert_equal 20, r.size 506 506 assert_equal 59, r.total_hits 507 507 508 r = Content.find_with_ferret('title OR comment', { :multi => Comment, :limit => 20 }, 509 { :conditions => { :comment => 'content is null', 510 :content => ["id != ?", id] }}) 511 assert_equal 20, r.size 512 assert_equal 29, r.total_hits 513 508 514 r = Content.find_with_ferret('title OR comment', { :multi => Comment }, 509 { :conditions => ["id != ?", id], :limit => 20 })515 { :conditions => { :content => ["id != ?", id] }, :limit => 20 }) 510 516 assert_equal 20, r.size 511 517 assert_equal 59, r.total_hits … … 838 844 id = Content.find_with_ferret('title').first.id 839 845 r = Content.find_with_ferret 'title OR comment', { :page => 1, :per_page => 10, :multi => Comment }, 840 { :conditions => ["id != ?", id], :order => 'id ASC' }846 { :conditions => { :content => ["id != ?", id] }, :order => 'id ASC' } 841 847 assert_equal 59, r.total_hits 842 848 assert_equal 10, r.size … … 847 853 848 854 r = Content.find_with_ferret 'title OR comment', { :page => 6, :per_page => 10, :multi => Comment }, 849 { :conditions => [ "id != ?", id ], :order => 'id ASC' }855 { :conditions => { :content => [ "id != ?", id ] }, :order => 'id ASC' } 850 856 assert_equal 59, r.total_hits 851 857 assert_equal 9, r.size
