Tests should not change settings.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9949 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -82,12 +82,13 @@ class NewsControllerTest < ActionController::TestCase
|
||||
|
||||
def test_post_create
|
||||
ActionMailer::Base.deliveries.clear
|
||||
Setting.notified_events << 'news_added'
|
||||
|
||||
@request.session[:user_id] = 2
|
||||
post :create, :project_id => 1, :news => { :title => 'NewsControllerTest',
|
||||
|
||||
with_settings :notified_events => %w(news_added) do
|
||||
post :create, :project_id => 1, :news => { :title => 'NewsControllerTest',
|
||||
:description => 'This is the description',
|
||||
:summary => '' }
|
||||
end
|
||||
assert_redirected_to '/projects/ecookbook/news'
|
||||
|
||||
news = News.find_by_title('NewsControllerTest')
|
||||
|
||||
Reference in New Issue
Block a user