summaryrefslogtreecommitdiffstats
path: root/test/unit/document_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-09-01 02:16:07 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-09-01 02:16:07 +0000
commit2516d4f40822aef07afa3d943b9650b98babb1ae (patch)
tree2e036fab402e773d90a1fd02bd1ae14939e5942b /test/unit/document_test.rb
parent03d6c4668ed234b5a90a2a369656935d2fe09ca1 (diff)
downloadredmine-2516d4f40822aef07afa3d943b9650b98babb1ae.tar.gz
redmine-2516d4f40822aef07afa3d943b9650b98babb1ae.zip
Merged r9949 from trunk to 1.4-stable
Tests should not change settings. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.4-stable@10250 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/document_test.rb')
-rw-r--r--test/unit/document_test.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/unit/document_test.rb b/test/unit/document_test.rb
index aa3026fa8..332092d94 100644
--- a/test/unit/document_test.rb
+++ b/test/unit/document_test.rb
@@ -30,10 +30,11 @@ class DocumentTest < ActiveSupport::TestCase
def test_create_should_send_email_notification
ActionMailer::Base.deliveries.clear
- Setting.notified_events << 'document_added'
- doc = Document.new(:project => Project.find(1), :title => 'New document', :category => Enumeration.find_by_name('User documentation'))
-
- assert doc.save
+
+ with_settings :notified_events => %w(document_added) do
+ doc = Document.new(:project => Project.find(1), :title => 'New document', :category => Enumeration.find_by_name('User documentation'))
+ assert doc.save
+ end
assert_equal 1, ActionMailer::Base.deliveries.size
end