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:
@@ -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|
|
||||
|
||||
Reference in New Issue
Block a user