diff options
Diffstat (limited to 'test/unit/mail_handler_test.rb')
-rw-r--r-- | test/unit/mail_handler_test.rb | 15 |
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) |