##// END OF EJS Templates
Fixed that the reminder email excludes issues assigned to groups (#11723)....
Fixed that the reminder email excludes issues assigned to groups (#11723). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10335 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r9766:7acd04fb8722
r10152:197a14a82e3e
Show More
journal_observer_test.rb
137 lines | 4.4 KiB | text/x-ruby | RubyLexer
/ test / unit / journal_observer_test.rb
Jean-Philippe Lang
Fixed: notes are lost when copying issue(s) (#6901, #8239)....
r5482 # Redmine - project management software
Jean-Philippe Lang
Copyright update....
r9453 # Copyright (C) 2006-2012 Jean-Philippe Lang
Eric Davis
Added three new notifiable events based on issue attributes...
r4107 #
# 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.
Toshi MARUYAMA
remove trailing white-spaces and an empty line from unit journal observer test....
r5687 #
Eric Davis
Added three new notifiable events based on issue attributes...
r4107 # 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.
Toshi MARUYAMA
remove trailing white-spaces and an empty line from unit journal observer test....
r5687 #
Eric Davis
Added three new notifiable events based on issue attributes...
r4107 # 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.
Jean-Baptiste Barth
Use absolute paths in test/**/* requires for Ruby 1.9.2 compatibility. #4050...
r4395 require File.expand_path('../../test_helper', __FILE__)
Eric Davis
Added three new notifiable events based on issue attributes...
r4107
class JournalObserverTest < ActiveSupport::TestCase
fixtures :issues, :issue_statuses, :journals, :journal_details
def setup
ActionMailer::Base.deliveries.clear
@journal = Journal.find 1
end
# context: issue_updated notified_events
def test_create_should_send_email_notification_with_issue_updated
issue = Issue.find(:first)
user = User.find(:first)
journal = issue.init_journal(user, issue)
Jean-Philippe Lang
Tests should not change settings....
r9766 with_settings :notified_events => %w(issue_updated) do
assert journal.save
end
Eric Davis
Added three new notifiable events based on issue attributes...
r4107 assert_equal 1, ActionMailer::Base.deliveries.size
end
Toshi MARUYAMA
remove trailing white-spaces and an empty line from unit journal observer test....
r5687
Jean-Philippe Lang
Fixed: notes are lost when copying issue(s) (#6901, #8239)....
r5482 def test_create_should_not_send_email_notification_with_notify_set_to_false
issue = Issue.find(:first)
user = User.find(:first)
journal = issue.init_journal(user, issue)
journal.notify = false
Toshi MARUYAMA
remove trailing white-spaces and an empty line from unit journal observer test....
r5687
Jean-Philippe Lang
Tests should not change settings....
r9766 with_settings :notified_events => %w(issue_updated) do
assert journal.save
end
Jean-Philippe Lang
Fixed: notes are lost when copying issue(s) (#6901, #8239)....
r5482 assert_equal 0, ActionMailer::Base.deliveries.size
end
Eric Davis
Added three new notifiable events based on issue attributes...
r4107
def test_create_should_not_send_email_notification_without_issue_updated
issue = Issue.find(:first)
user = User.find(:first)
journal = issue.init_journal(user, issue)
Jean-Philippe Lang
Tests should not change settings....
r9766 with_settings :notified_events => [] do
assert journal.save
end
Eric Davis
Added three new notifiable events based on issue attributes...
r4107 assert_equal 0, ActionMailer::Base.deliveries.size
end
# context: issue_note_added notified_events
def test_create_should_send_email_notification_with_issue_note_added
issue = Issue.find(:first)
user = User.find(:first)
journal = issue.init_journal(user, issue)
journal.notes = 'This update has a note'
Jean-Philippe Lang
Tests should not change settings....
r9766 with_settings :notified_events => %w(issue_note_added) do
assert journal.save
end
Eric Davis
Added three new notifiable events based on issue attributes...
r4107 assert_equal 1, ActionMailer::Base.deliveries.size
end
def test_create_should_not_send_email_notification_without_issue_note_added
issue = Issue.find(:first)
user = User.find(:first)
journal = issue.init_journal(user, issue)
journal.notes = 'This update has a note'
Toshi MARUYAMA
remove trailing white-spaces and an empty line from unit journal observer test....
r5687
Jean-Philippe Lang
Tests should not change settings....
r9766 with_settings :notified_events => [] do
assert journal.save
end
Eric Davis
Added three new notifiable events based on issue attributes...
r4107 assert_equal 0, ActionMailer::Base.deliveries.size
end
# context: issue_status_updated notified_events
def test_create_should_send_email_notification_with_issue_status_updated
issue = Issue.find(:first)
user = User.find(:first)
issue.init_journal(user, issue)
issue.status = IssueStatus.last
Jean-Philippe Lang
Tests should not change settings....
r9766 with_settings :notified_events => %w(issue_status_updated) do
assert issue.save
end
Eric Davis
Added three new notifiable events based on issue attributes...
r4107 assert_equal 1, ActionMailer::Base.deliveries.size
end
def test_create_should_not_send_email_notification_without_issue_status_updated
issue = Issue.find(:first)
user = User.find(:first)
issue.init_journal(user, issue)
issue.status = IssueStatus.last
Toshi MARUYAMA
remove trailing white-spaces and an empty line from unit journal observer test....
r5687
Jean-Philippe Lang
Tests should not change settings....
r9766 with_settings :notified_events => [] do
assert issue.save
end
Eric Davis
Added three new notifiable events based on issue attributes...
r4107 assert_equal 0, ActionMailer::Base.deliveries.size
end
# context: issue_priority_updated notified_events
def test_create_should_send_email_notification_with_issue_priority_updated
issue = Issue.find(:first)
user = User.find(:first)
issue.init_journal(user, issue)
issue.priority = IssuePriority.last
Jean-Philippe Lang
Tests should not change settings....
r9766 with_settings :notified_events => %w(issue_priority_updated) do
assert issue.save
end
Eric Davis
Added three new notifiable events based on issue attributes...
r4107 assert_equal 1, ActionMailer::Base.deliveries.size
end
def test_create_should_not_send_email_notification_without_issue_priority_updated
issue = Issue.find(:first)
user = User.find(:first)
issue.init_journal(user, issue)
issue.priority = IssuePriority.last
Toshi MARUYAMA
remove trailing white-spaces and an empty line from unit journal observer test....
r5687
Jean-Philippe Lang
Tests should not change settings....
r9766 with_settings :notified_events => [] do
assert issue.save
end
Eric Davis
Added three new notifiable events based on issue attributes...
r4107 assert_equal 0, ActionMailer::Base.deliveries.size
end
end