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:
- 758 Bytes
- Properties:
- Property svn:executable is set
1 | #!/bin/env ruby |
2 | |
3 | require File.dirname(__FILE__) + '/../test_helper' |
4 | |
5 | class PostvoteTest < Test::Unit::TestCase |
6 | fixtures "post_votes", "topics", "posts", "users" |
7 | |
8 | def test_vote |
9 | post = Post.find(11) # user_id of this post is 1 |
10 | user = User.find(2) |
11 | |
12 | # voting for own post is not allowed |
13 | assert_raises(ArgumentError) { post.user.vote_post(post, 0) } |
14 | |
15 | # set vote |
16 | user.vote_post(post, -5) |
17 | assert_equal -5.0, PostVote.rate(post) |
18 | |
19 | # update vote |
20 | user.vote_post(post, 10) |
21 | assert_equal 10.0, PostVote.rate(post) |
22 | |
23 | # value out of range |
24 | assert_raises(ArgumentError) { user.vote_post(post, 11) } |
25 | |
26 | user = User.find(3) |
27 | user.vote_post(post, -5) |
28 | assert_equal 2.5, PostVote.rate(post) |
29 | end |
30 | end |