Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 7
- Log:
Initial import of RForum 0.2 sources from a downloaded Tarball.
RForum is a Ruby On Rails based forum and mail gateway service.
- Author:
- adh
- Date:
- Sat Jul 22 18:43:13 +0100 2006
- Size:
- 850 Bytes
- Properties:
- Property svn:executable is set
1 | #!/bin/env ruby |
2 | |
3 | require File.dirname(__FILE__) + '/../test_helper' |
4 | |
5 | class AdminTest < Test::Unit::TestCase |
6 | |
7 | fixtures 'users', 'posts', 'topics' |
8 | |
9 | def setup |
10 | @admin = User.find(1) |
11 | end |
12 | |
13 | def test_can_delete? |
14 | # own post that's not a root of a topic |
15 | assert @admin.can_delete?(Post.find(3)) |
16 | # somebody else's post |
17 | assert @admin.can_delete?(Post.find(102)) |
18 | # root post of a topic (still can be deleted) |
19 | assert @admin.can_delete?(Post.find(1)) |
20 | # anonymous post |
21 | Post.update 102, {'user_id' => nil} |
22 | assert @admin.can_delete?(Post.find(102)) |
23 | end |
24 | |
25 | def test_can_edit? |
26 | # post is own |
27 | assert @admin.can_edit?(Post.find(1)) |
28 | # post is somebody else's |
29 | assert @admin.can_edit?(Post.find(2)) |
30 | # anonymous post |
31 | Post.update 2, {'user_id' => nil} |
32 | assert @admin.can_edit?(Post.find(2)) |
33 | end |
34 | |
35 | end |