diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2013-12-06 23:22:15 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2013-12-06 23:22:15 +0000 |
commit | dceee1ea9a1df45a36303b9ee213519e14afd8ed (patch) | |
tree | b7af2a953da02605e435a940ea8369529c3d0a0c /test/unit/issue_test.rb | |
parent | 9223ab42522948f290ca8758210c2a74462a2726 (diff) | |
download | redmine-dceee1ea9a1df45a36303b9ee213519e14afd8ed.tar.gz redmine-dceee1ea9a1df45a36303b9ee213519e14afd8ed.zip |
explicitly use mail send setting in unit issue test (#15612)
git-svn-id: http://svn.redmine.org/redmine/trunk@12361 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_test.rb')
-rw-r--r-- | test/unit/issue_test.rb | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index 8f9f965cb..90e529a4c 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -1695,9 +1695,10 @@ class IssueTest < ActiveSupport::TestCase :author_id => 3, :status_id => 1, :priority => IssuePriority.all.first, :subject => 'test_create', :estimated_hours => '1:30') - - assert issue.save - assert_equal 1, ActionMailer::Base.deliveries.size + with_settings :notified_events => %w(issue_added) do + assert issue.save + assert_equal 1, ActionMailer::Base.deliveries.size + end end def test_stale_issue_should_not_send_email_notification @@ -1707,16 +1708,18 @@ class IssueTest < ActiveSupport::TestCase issue.init_journal(User.find(1)) issue.subject = 'Subjet update' - assert issue.save - assert_equal 1, ActionMailer::Base.deliveries.size - ActionMailer::Base.deliveries.clear + with_settings :notified_events => %w(issue_updated) do + 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 + 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 - assert ActionMailer::Base.deliveries.empty? end def test_journalized_description |