summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-04-08 19:11:30 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-04-08 19:11:30 +0000
commit10cbdf5d96515ecfc74f84a7475327bcca69f28b (patch)
tree4b8c1d66547d4dd7ed62efc06a702711ecaf7d8e /test
parentc90878c8173c77d229f183a1850ece49f550cce0 (diff)
downloadredmine-10cbdf5d96515ecfc74f84a7475327bcca69f28b.tar.gz
redmine-10cbdf5d96515ecfc74f84a7475327bcca69f28b.zip
Create the journal after issue save (#3140).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2669 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/issue_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index ae3fa5bda..5052f7a0c 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -249,4 +249,23 @@ class IssueTest < Test::Unit::TestCase
assert issue.save
assert_equal 1, ActionMailer::Base.deliveries.size
end
+
+ def test_stale_issue_should_not_send_email_notification
+ ActionMailer::Base.deliveries.clear
+ issue = Issue.find(1)
+ stale = Issue.find(1)
+
+ issue.init_journal(User.find(1))
+ issue.subject = 'Subjet update'
+ assert issue.save
+ assert_equal 1, ActionMailer::Base.deliveries.size
+ ActionMailer::Base.deliveries.clear
+
+ stale.init_journal(User.find(1))
+ stale.subject = 'Another subjet update'
+ assert_raise ActiveRecord::StaleObjectError do
+ stale.save
+ end
+ assert ActionMailer::Base.deliveries.empty?
+ end
end