| | 62 | end |
|---|
| | 63 | |
|---|
| | 64 | def test_ferret_destroy |
|---|
| | 65 | SharedIndex1.rebuild_index(SharedIndex2) |
|---|
| | 66 | result = SharedIndex1.find_id_by_contents("first OR another", :models => :all) |
|---|
| | 67 | assert_equal 4, result.first |
|---|
| | 68 | shared_index1s(:first).ferret_destroy |
|---|
| | 69 | result = SharedIndex1.find_id_by_contents("first OR another", :models => :all) |
|---|
| | 70 | assert_equal 3, result.first |
|---|
| | 71 | end |
|---|
| | 72 | |
|---|
| | 73 | def test_ferret_destroy_ticket_88 |
|---|
| | 74 | SharedIndex1.rebuild_index(SharedIndex2) |
|---|
| | 75 | result = SharedIndex1.find_id_by_contents("first OR another", :models => :all) |
|---|
| | 76 | assert_equal 4, result.first |
|---|
| | 77 | result = SharedIndex2.find_id_by_contents("first OR another", :models => :all) |
|---|
| | 78 | assert_equal 4, result.first |
|---|
| | 79 | SharedIndex1.destroy(shared_index1s(:first)) |
|---|
| | 80 | result = SharedIndex1.find_id_by_contents("first OR another", :models => :all) |
|---|
| | 81 | assert_equal 3, result.first |
|---|
| | 82 | result = SharedIndex2.find_id_by_contents("first OR another", :models => :all) |
|---|
| | 83 | assert_equal 3, result.first |
|---|
| | 84 | shared_index2s(:first).destroy |
|---|
| | 85 | result = SharedIndex1.find_id_by_contents("first OR another", :models => :all) |
|---|
| | 86 | assert_equal 2, result.first |
|---|
| | 87 | result = SharedIndex2.find_id_by_contents("first OR another", :models => :all) |
|---|
| | 88 | assert_equal 2, result.first |
|---|