Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 10
- Log:
Checking in HEAD from RForum's SVN of 22-Jul-2006, 8pm (revision 906).
- Author:
- adh
- Date:
- Sat Jul 22 20:02:44 +0100 2006
- Size:
- 1016 Bytes
1 | #!/bin/env ruby |
2 | |
3 | require File.dirname(__FILE__) + '/../test_helper' |
4 | |
5 | class SearchFerretTest < Test::Unit::TestCase |
6 | fixtures 'posts', 'topics', 'forums', 'users' |
7 | |
8 | def setup |
9 | Post.rebuild_index |
10 | end |
11 | |
12 | def teardown |
13 | # Post.search_handler.index.close |
14 | end |
15 | |
16 | def test_rebuild_index |
17 | assert_equal Post.count, Post.ferret_index.size |
18 | Post.rebuild_index |
19 | assert_equal Post.count, Post.ferret_index.size |
20 | end |
21 | |
22 | def test_search |
23 | assert_equal Post.count("deleted = 0 AND text LIKE '%xyz%'"), Post.search('xyz', [], 999, 0).size |
24 | end |
25 | |
26 | def test_search_by_forum |
27 | topics = Forum.find(2).topics.find(:all, :conditions => 'deleted=0') |
28 | sum = topics.inject(0) { |n, t| n + t.post_counter } |
29 | assert_equal sum, Post.search('', [2], 999, 0).size |
30 | end |
31 | |
32 | def test_update |
33 | Post.find(21).hide |
34 | assert_equal Post.count('deleted=0') + 1, Post.search('', [], 999, 0).size |
35 | Post.manual_index_update |
36 | assert_equal Post.count('deleted=0'), Post.search('', [], 999, 0).size |
37 | end |
38 | |
39 | end |