end
def edit
- @notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted)
+ @notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted wiki_content_added wiki_content_updated)
if request.post? && params[:settings] && params[:settings].is_a?(Hash)
settings = (params[:settings] || {}).dup.symbolize_keys
settings.each do |name, value|
body :message => message,
:message_url => url_for(:controller => 'messages', :action => 'show', :board_id => message.board_id, :id => message.root)
end
+
+ # Builds a tmail object used to email the recipients of a project of the specified wiki content was updated.
+ #
+ # Example:
+ # wiki_content_updated(wiki_content) => tmail object
+ # Mailer.deliver_wiki_content_updated(wiki_content) => sends an email to the project's recipients
+ def wiki_content_added(wiki_content)
+ redmine_headers 'Project' => wiki_content.project.identifier,
+ 'Wiki-Page-Id' => wiki_content.page.id
+ message_id wiki_content
+ recipients wiki_content.project.recipients
+ subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :page => wiki_content.page.pretty_title)}"
+ body :wiki_content => wiki_content,
+ :wiki_content_url => url_for(:controller => 'wiki', :action => 'index', :id => wiki_content.project, :page => wiki_content.page.title)
+ end
+
+ # Builds a tmail object used to email the recipients of a project of the specified wiki content was updated.
+ #
+ # Example:
+ # wiki_content_updated(wiki_content) => tmail object
+ # Mailer.deliver_wiki_content_updated(wiki_content) => sends an email to the project's recipients
+ def wiki_content_updated(wiki_content)
+ redmine_headers 'Project' => wiki_content.project.identifier,
+ 'Wiki-Page-Id' => wiki_content.page.id
+ message_id wiki_content
+ recipients wiki_content.project.recipients
+ subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_updated, :page => wiki_content.page.pretty_title)}"
+ body :wiki_content => wiki_content,
+ :wiki_content_url => url_for(:controller => 'wiki', :action => 'index', :id => wiki_content.project, :page => wiki_content.page.title),
+ :wiki_diff_url => url_for(:controller => 'wiki', :action => 'diff', :id => wiki_content.project, :page => wiki_content.page.title, :version => wiki_content.version)
+ end
# Builds a tmail object used to email the specified user their account information.
#
def self.message_id_for(object)
# id + timestamp should reduce the odds of a collision
# as far as we don't send multiple emails for the same object
- hash = "redmine.#{object.class.name.demodulize.underscore}-#{object.id}.#{object.created_on.strftime("%Y%m%d%H%M%S")}"
+ timestamp = object.send(object.respond_to?(:created_on) ? :created_on : :updated_on)
+ hash = "redmine.#{object.class.name.demodulize.underscore}-#{object.id}.#{timestamp.strftime("%Y%m%d%H%M%S")}"
host = Setting.mail_from.to_s.gsub(%r{^.*@}, '')
host = "#{::Socket.gethostname}.redmine" if host.empty?
"<#{hash}@#{host}>"
validates_length_of :comments, :maximum => 255, :allow_nil => true
acts_as_versioned
+
+ def project
+ page.project
+ end
+
class Version
belongs_to :page, :class_name => '::WikiPage', :foreign_key => 'page_id'
belongs_to :author, :class_name => '::User', :foreign_key => 'author_id'
:conditions => ["wiki_content_id = ? AND version < ?", wiki_content_id, version])
end
end
-
end
--- /dev/null
+# Redmine - project management software
+# Copyright (C) 2006-2009 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+class WikiContentObserver < ActiveRecord::Observer
+ def after_create(wiki_content)
+ Mailer.deliver_wiki_content_added(wiki_content) if Setting.notified_events.include?('wiki_content_added')
+ end
+
+ def after_update(wiki_content)
+ if wiki_content.text_changed?
+ Mailer.deliver_wiki_content_updated(wiki_content) if Setting.notified_events.include?('wiki_content_updated')
+ end
+ end
+end
--- /dev/null
+<p><%= l(:mail_body_wiki_content_added, :page => link_to(h(@wiki_content.page.pretty_title), @wiki_content_url),
+ :author => h(@wiki_content.author)) %><br />
+<em><%=h @wiki_content.comments %></em></p>
--- /dev/null
+<%= l(:mail_body_wiki_content_added, :page => h(@wiki_content.page.pretty_title),
+ :author => h(@wiki_content.author)) %>
+<%= @wiki_content.comments %>
+
+<%= @wiki_content_url %>
--- /dev/null
+<p><%= l(:mail_body_wiki_content_updated, :page => link_to(h(@wiki_content.page.pretty_title), @wiki_content_url),
+ :author => h(@wiki_content.author)) %><br />
+<em><%=h @wiki_content.comments %></em></p>
+
+<p><%= l(:label_view_diff) %>:<br />
+<%= link_to @wiki_diff_url, @wiki_diff_url %></p>
--- /dev/null
+<%= l(:mail_body_wiki_content_updated, :page => h(@wiki_content.page.pretty_title),
+ :author => h(@wiki_content.author)) %>
+<%= @wiki_content.comments %>
+
+<%= @wiki_content.page.pretty_title %>:
+<%= @wiki_content_url %>
+<%= l(:label_view_diff) %>:
+<%= @wiki_diff_url %>
# Activate observers that should always be running
# config.active_record.observers = :cacher, :garbage_collector
- config.active_record.observers = :message_observer, :issue_observer, :journal_observer, :news_observer, :document_observer
+ config.active_record.observers = :message_observer, :issue_observer, :journal_observer, :news_observer, :document_observer, :wiki_content_observer
# Make Active Record use UTC-base instead of local time
# config.active_record.default_timezone = :utc
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants\r
setting_password_min_length: Minimum password length\r
field_group_by: Group results by\r
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"\r
+ label_wiki_content_added: Wiki page added\r
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"\r
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.\r
+ label_wiki_content_updated: Wiki page updated\r
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.\r
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
mail_body_account_activation_request: "A new user ({{value}}) has registered. The account is pending your approval:"
mail_subject_reminder: "{{count}} issue(s) due in the next days"
mail_body_reminder: "{{count}} issue(s) that are assigned to you are due in the next {{days}} days:"
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: "The '{{page}}' wiki page has been added by {{author}}."
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ mail_body_wiki_content_updated: "The '{{page}}' wiki page has been updated by {{author}}."
gui_validation_error: 1 error
gui_validation_error_plural: "{{count}} errors"
label_ascending: Ascending
label_descending: Descending
label_date_from_to: From {{start}} to {{end}}
+ label_wiki_content_added: Wiki page added
+ label_wiki_content_updated: Wiki page updated
button_login: Login
button_submit: Submit
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
mail_body_account_activation_request: "Un nouvel utilisateur ({{value}}) s'est inscrit. Son compte nécessite votre approbation:"
mail_subject_reminder: "{{count}} demande(s) arrivent à échéance"
mail_body_reminder: "{{count}} demande(s) qui vous sont assignées arrivent à échéance dans les {{days}} prochains jours:"
+ mail_subject_wiki_content_added: "Page wiki '{{page}}' ajoutée"
+ mail_body_wiki_content_added: "La page wiki '{{page}}' a été ajoutée par {{author}}."
+ mail_subject_wiki_content_updated: "Page wiki '{{page}}' mise à jour"
+ mail_body_wiki_content_updated: "La page wiki '{{page}}' a été mise à jour par {{author}}."
gui_validation_error: 1 erreur
gui_validation_error_plural: "{{count}} erreurs"
label_ascending: Croissant
label_descending: Décroissant
label_date_from_to: Du {{start}} au {{end}}
+ label_wiki_content_added: Page wiki ajoutée
+ label_wiki_content_updated: Page wiki mise à jour
button_login: Connexion
button_submit: Soumettre
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
text_wiki_page_destroy_children: Delete child pages and all their descendants
setting_password_min_length: Minimum password length
field_group_by: Group results by
+ mail_subject_wiki_content_updated: "'{{page}}' wiki page has been updated"
+ label_wiki_content_added: Wiki page added
+ mail_subject_wiki_content_added: "'{{page}}' wiki page has been added"
+ mail_body_wiki_content_added: The '{{page}}' wiki page has been added by {{author}}.
+ label_wiki_content_updated: Wiki page updated
+ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}.
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
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|