summaryrefslogtreecommitdiffstats
path: root/test/functional/files_controller_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/functional/files_controller_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/functional/files_controller_test.rb')
-rw-r--r--test/functional/files_controller_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/functional/files_controller_test.rb b/test/functional/files_controller_test.rb
index d05557990..5e3c9d68b 100644
--- a/test/functional/files_controller_test.rb
+++ b/test/functional/files_controller_test.rb
@@ -58,13 +58,14 @@ class FilesControllerTest < ActionController::TestCase
def test_create_file
set_tmp_attachments_directory
@request.session[:user_id] = 2
- Setting.notified_events = ['file_added']
ActionMailer::Base.deliveries.clear
- assert_difference 'Attachment.count' do
- post :create, :project_id => 1, :version_id => '',
- :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
- assert_response :redirect
+ with_settings :notified_events => %w(file_added) do
+ assert_difference 'Attachment.count' do
+ post :create, :project_id => 1, :version_id => '',
+ :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
+ assert_response :redirect
+ end
end
assert_redirected_to '/projects/ecookbook/files'
a = Attachment.find(:first, :order => 'created_on DESC')
@@ -80,7 +81,6 @@ class FilesControllerTest < ActionController::TestCase
def test_create_version_file
set_tmp_attachments_directory
@request.session[:user_id] = 2
- Setting.notified_events = ['file_added']
assert_difference 'Attachment.count' do
post :create, :project_id => 1, :version_id => '2',