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
This commit is contained in:
Toshi MARUYAMA 2013-12-06 23:22:15 +00:00
parent 9223ab4252
commit dceee1ea9a
1 changed files with 14 additions and 11 deletions

View File

@ -1695,9 +1695,10 @@ class IssueTest < ActiveSupport::TestCase
:author_id => 3, :status_id => 1, :author_id => 3, :status_id => 1,
:priority => IssuePriority.all.first, :priority => IssuePriority.all.first,
:subject => 'test_create', :estimated_hours => '1:30') :subject => 'test_create', :estimated_hours => '1:30')
with_settings :notified_events => %w(issue_added) do
assert issue.save assert issue.save
assert_equal 1, ActionMailer::Base.deliveries.size assert_equal 1, ActionMailer::Base.deliveries.size
end
end end
def test_stale_issue_should_not_send_email_notification def test_stale_issue_should_not_send_email_notification
@ -1707,16 +1708,18 @@ class IssueTest < ActiveSupport::TestCase
issue.init_journal(User.find(1)) issue.init_journal(User.find(1))
issue.subject = 'Subjet update' issue.subject = 'Subjet update'
assert issue.save with_settings :notified_events => %w(issue_updated) do
assert_equal 1, ActionMailer::Base.deliveries.size assert issue.save
ActionMailer::Base.deliveries.clear assert_equal 1, ActionMailer::Base.deliveries.size
ActionMailer::Base.deliveries.clear
stale.init_journal(User.find(1)) stale.init_journal(User.find(1))
stale.subject = 'Another subjet update' stale.subject = 'Another subjet update'
assert_raise ActiveRecord::StaleObjectError do assert_raise ActiveRecord::StaleObjectError do
stale.save stale.save
end
assert ActionMailer::Base.deliveries.empty?
end end
assert ActionMailer::Base.deliveries.empty?
end end
def test_journalized_description def test_journalized_description