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
This commit is contained in:
Jean-Philippe Lang
2009-05-17 09:55:13 +00:00
parent 6e0a818caf
commit 9c9dc6e814
44 changed files with 314 additions and 4 deletions
+20
View File
@@ -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|