mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 12:06:33 +02:00
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5602 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -522,6 +522,11 @@ class IssueTest < ActiveSupport::TestCase
|
||||
@issue = Issue.find(1)
|
||||
@copy = nil
|
||||
end
|
||||
|
||||
should "not create a journal" do
|
||||
@copy = @issue.move_to_project(Project.find(3), Tracker.find(2), {:copy => true, :attributes => {:assigned_to_id => 3}})
|
||||
assert_equal 0, @copy.reload.journals.size
|
||||
end
|
||||
|
||||
should "allow assigned_to changes" do
|
||||
@copy = @issue.move_to_project(Project.find(3), Tracker.find(2), {:copy => true, :attributes => {:assigned_to_id => 3}})
|
||||
@@ -552,6 +557,19 @@ class IssueTest < ActiveSupport::TestCase
|
||||
|
||||
assert_equal User.current, @copy.author
|
||||
end
|
||||
|
||||
should "keep journal notes" do
|
||||
date = Date.today
|
||||
notes = "Notes added when copying"
|
||||
User.current = User.find(9)
|
||||
@issue.init_journal(User.current, notes)
|
||||
@copy = @issue.move_to_project(Project.find(3), Tracker.find(2), {:copy => true, :attributes => {:start_date => date}})
|
||||
|
||||
assert_equal 1, @copy.journals.size
|
||||
journal = @copy.journals.first
|
||||
assert_equal 0, journal.details.size
|
||||
assert_equal notes, journal.notes
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2011 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
|
||||
@@ -35,6 +35,17 @@ class JournalObserverTest < ActiveSupport::TestCase
|
||||
assert journal.save
|
||||
assert_equal 1, ActionMailer::Base.deliveries.size
|
||||
end
|
||||
|
||||
def test_create_should_not_send_email_notification_with_notify_set_to_false
|
||||
Setting.notified_events = ['issue_updated']
|
||||
issue = Issue.find(:first)
|
||||
user = User.find(:first)
|
||||
journal = issue.init_journal(user, issue)
|
||||
journal.notify = false
|
||||
|
||||
assert journal.save
|
||||
assert_equal 0, ActionMailer::Base.deliveries.size
|
||||
end
|
||||
|
||||
def test_create_should_not_send_email_notification_without_issue_updated
|
||||
Setting.notified_events = []
|
||||
|
||||
Reference in New Issue
Block a user