| Class | CommentTest |
| In: |
test/unit/comment_test.rb
|
| Parent: | Test::Unit::TestCase |
# File test/unit/comment_test.rb, line 21
21: def setup
22: logger.debug "Test Case: #{name}"
23: @andy = users(:andy)
24: @cash = users(:cash)
25: end
Shows that a user will start receiving notifications about page changes after creating a comment about a page
# File test/unit/comment_test.rb, line 28
28: def test_notification
29: wiki = create_templates
30: wiki.reload
31: version = Version.find(:first)
32: assert !Notification.find_all_users(version.page, Page.name).include?(@andy)
33: Comment.create(:text => 'test', :user => @andy, :version => version, :page => version.page, :site => version.wiki)
34: assert Notification.find_all_users(version.page, Page.name).include?(@andy)
35: Comment.create(:text => 'another test', :user => @andy, :version => version, :page => version.page, :site => version.wiki)
36: assert Notification.find_all_users(version.page, Page.name).include?(@andy)
37: Comment.create(:text => 'another test', :user => @cash, :version => version, :page => version.page, :site => version.wiki)
38: assert Notification.find_all_users(version.page, Page.name).include?(@cash)
39: end