Changeset 320 for trunk/demo/test/unit/shared_index1_test.rb
- Timestamp:
- 02/18/08 20:36:05 (9 months ago)
- Files:
-
- trunk/demo/test/unit/shared_index1_test.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/demo/test/unit/shared_index1_test.rb
r319 r320 8 8 end 9 9 10 def test_lazy_loading _shared_index11 results = SharedIndex1.find_with_ferret 'first', :lazy => [ :name ], :models => :all10 def test_lazy_loading 11 results = ActsAsFerret::find 'first', 'shared', :lazy => [ :name ] 12 12 assert_equal 2, results.size 13 13 found_lazy_result = false … … 33 33 assert_equal 1, result.size, result.inspect 34 34 assert_equal shared_index1s(:first), result.first 35 36 result = SharedIndex1.find_with_ferret("name:first", :models => [SharedIndex1])37 assert_equal 1, result.size38 assert_equal shared_index1s(:first), result.first39 35 end 40 36 … … 45 41 end 46 42 47 def test_find_with_ ferret_all_classes48 result = SharedIndex1.find_with_ferret("first", :models => :all)43 def test_find_with_index_name 44 result = ActsAsFerret::find("first", 'shared') 49 45 assert_equal 2, result.size 50 46 assert result.include?(shared_index1s(:first)) 51 47 assert result.include?(shared_index2s(:first)) 48 end 52 49 53 result = SharedIndex1.find_with_ferret("name:first", :models => [SharedIndex2]) 50 def test_find_with_class_list 51 result = ActsAsFerret::find("name:first", [SharedIndex1, SharedIndex2]) 54 52 assert_equal 2, result.size 55 53 assert result.include?(shared_index1s(:first)) 56 54 assert result.include?(shared_index2s(:first)) 57 58 55 end 59 56 … … 63 60 64 61 def test_destroy 65 result = SharedIndex1.find_with_ferret("first OR another", :models => :all)62 result = ActsAsFerret::find("first OR another", 'shared') 66 63 assert_equal 4, result.size 67 64 SharedIndex1.destroy(shared_index1s(:first)) 68 result = SharedIndex1.find_with_ferret("first OR another", :models => :all)65 result = ActsAsFerret::find("first OR another", 'shared') 69 66 assert_equal 3, result.size 70 67 shared_index2s(:first).destroy 71 result = SharedIndex1.find_with_ferret("first OR another", :models => :all)68 result = ActsAsFerret::find("first OR another", 'shared') 72 69 assert_equal 2, result.size 73 70 end
