summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-05-17 09:55:13 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-05-17 09:55:13 +0000
commit9c9dc6e8147a3e0bf3239511c094dc5f9d2a59a0 (patch)
treefb2dc8222bc9a9296d127115f600198d0486c879 /test
parent6e0a818cafadfc48d74845ebedb933f4ecf2aa53 (diff)
downloadredmine-9c9dc6e8147a3e0bf3239511c094dc5f9d2a59a0.tar.gz
redmine-9c9dc6e8147a3e0bf3239511c094dc5f9d2a59a0.zip
Adds email notification on wiki changes (#413). It's disabled by default and can be enabled in application settings.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2749 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/wiki_content_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/unit/wiki_content_test.rb b/test/unit/wiki_content_test.rb
index a8c28ae21..f3f8bc041 100644
--- a/test/unit/wiki_content_test.rb
+++ b/test/unit/wiki_content_test.rb
@@ -40,6 +40,16 @@ class WikiContentTest < Test::Unit::TestCase
assert_equal User.find(1), content.author
assert_equal content.text, content.versions.last.text
end
+
+ def test_create_should_send_email_notification
+ Setting.notified_events = ['wiki_content_added']
+ ActionMailer::Base.deliveries.clear
+ page = WikiPage.new(:wiki => @wiki, :title => "A new page")
+ page.content = WikiContent.new(:text => "Content text", :author => User.find(1), :comments => "My comment")
+ assert page.save
+
+ assert_equal 1, ActionMailer::Base.deliveries.size
+ end
def test_update
content = @page.content
@@ -51,6 +61,16 @@ class WikiContentTest < Test::Unit::TestCase
assert_equal version_count+1, content.versions.length
end
+ def test_update_should_send_email_notification
+ Setting.notified_events = ['wiki_content_updated']
+ ActionMailer::Base.deliveries.clear
+ content = @page.content
+ content.text = "My new content"
+ assert content.save
+
+ assert_equal 1, ActionMailer::Base.deliveries.size
+ end
+
def test_fetch_history
assert !@page.content.versions.empty?
@page.content.versions.each do |version|