summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-11-24 11:22:34 +0000
committerGo MAEDA <maeda@farend.jp>2018-11-24 11:22:34 +0000
commit7564b2cf458749500ddc0ad789325cb3fe8fb17c (patch)
tree42fdd824337dc00a7809dbec529cadb1591029e6 /test/unit
parenta9ea3c4e1564bf6d619eadb87a1048b2deaa88e8 (diff)
downloadredmine-7564b2cf458749500ddc0ad789325cb3fe8fb17c.tar.gz
redmine-7564b2cf458749500ddc0ad789325cb3fe8fb17c.zip
Merged r17630 from trunk to 3.3-stable (#28576).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@17632 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/mail_handler_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb
index dd4b60d50..7752cd386 100644
--- a/test/unit/mail_handler_test.rb
+++ b/test/unit/mail_handler_test.rb
@@ -832,6 +832,21 @@ class MailHandlerTest < ActiveSupport::TestCase
assert_equal 'Paella.jpg', detail.value
end
+ def test_update_issue_should_discard_all_changes_on_validation_failure
+ Issue.any_instance.stubs(:valid?).returns(false)
+ assert_no_difference 'Journal.count' do
+ assert_no_difference 'JournalDetail.count' do
+ assert_no_difference 'Attachment.count' do
+ assert_no_difference 'Issue.count' do
+ journal = submit_email('ticket_with_attachment.eml') do |raw|
+ raw.gsub! /^Subject: .*$/, 'Subject: Re: [Cookbook - Feature #2] (New) Add ingredients categories'
+ end
+ end
+ end
+ end
+ end
+ end
+
def test_update_issue_should_send_email_notification
journal = submit_email('ticket_reply.eml')
assert journal.is_a?(Journal)