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:
- 1159 Bytes
- Properties:
- Property svn:executable is set
1 | #!/bin/env ruby |
2 | |
3 | require File.dirname(__FILE__) + '/../test_helper' |
4 | |
5 | class TopicSubscriptionTest < Test::Unit::TestCase |
6 | fixtures 'users', 'topics', 'posts', 'topic_subscriptions', 'topic_reads' |
7 | |
8 | def setup |
9 | RForum::CONFIG[:deliver_mail] = false |
10 | end |
11 | |
12 | def test_subscription |
13 | user = User.find 1 |
14 | topic = Topic.find 1 |
15 | |
16 | assert !topic.subscribed_by?(user) |
17 | user.subscribe_topic(topic) |
18 | assert topic.subscribed_by?(user) |
19 | |
20 | # resubscribe; this is a no-op, but mustn't fail |
21 | user.subscribe_topic(topic) |
22 | assert_equal 1, TopicSubscription.find_all("user_id = #{user.id} AND topic_id = #{topic.id}").size |
23 | |
24 | # notification email |
25 | ActionMailer::Base.deliveries = [] |
26 | topic.add_reply Post.new(prototype_params(Post, 'subject' => 'aaaaaaa', 'messageid' => nil)) |
27 | assert_equal 1, ActionMailer::Base.deliveries.size |
28 | |
29 | # no notification for own post |
30 | ActionMailer::Base.deliveries = [] |
31 | topic.add_reply Post.new(prototype_params(Post, 'subject' => 'aaaaaaa', 'user_id' => user.id)) |
32 | assert_equal 0, ActionMailer::Base.deliveries.size |
33 | |
34 | user.unsubscribe_topic(topic) |
35 | assert !topic.subscribed_by?(user) |
36 | end |
37 | end |