summaryrefslogtreecommitdiffstats
path: root/test/unit/news_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-08 12:23:47 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-08 12:23:47 +0000
commit7acd04fb87229cd35c5c7a765bf1cfe9aaf69052 (patch)
tree5f0ebbf6dad1356c3ec76fff9fb96344c28e138c /test/unit/news_test.rb
parent133ca59edb5aa835fd8c9f967c06d8b5a4e8d581 (diff)
downloadredmine-7acd04fb87229cd35c5c7a765bf1cfe9aaf69052.tar.gz
redmine-7acd04fb87229cd35c5c7a765bf1cfe9aaf69052.zip
Tests should not change settings.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9949 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/news_test.rb')
-rw-r--r--test/unit/news_test.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/unit/news_test.rb b/test/unit/news_test.rb
index 71b939d63..94054e5a7 100644
--- a/test/unit/news_test.rb
+++ b/test/unit/news_test.rb
@@ -29,10 +29,11 @@ class NewsTest < ActiveSupport::TestCase
def test_create_should_send_email_notification
ActionMailer::Base.deliveries.clear
- Setting.notified_events << 'news_added'
news = Project.find(1).news.new(valid_news)
- assert news.save
+ with_settings :notified_events => %w(news_added) do
+ assert news.save
+ end
assert_equal 1, ActionMailer::Base.deliveries.size
end