]> source.dussan.org Git - redmine.git/commitdiff
Prevent fixture files from being deleted.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 29 Nov 2011 18:51:39 +0000 (18:51 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 29 Nov 2011 18:51:39 +0000 (18:51 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7983 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/attachments_controller_test.rb

index 42076b57e6b54ad6c47559e7e5de48029ccf6c7a..50b19c26084dbaada847ea6694373bbd6787c6c7 100644 (file)
@@ -220,6 +220,7 @@ class AttachmentsControllerTest < ActionController::TestCase
   end
 
   def test_destroy_issue_attachment
+    set_tmp_attachments_directory
     issue = Issue.find(3)
     @request.session[:user_id] = 2
 
@@ -233,42 +234,41 @@ class AttachmentsControllerTest < ActionController::TestCase
     assert_equal 'attachment', j.details.first.property
     assert_equal '1', j.details.first.prop_key
     assert_equal 'error281.txt', j.details.first.old_value
-    set_tmp_attachments_directory
   end
 
   def test_destroy_wiki_page_attachment
+    set_tmp_attachments_directory
     @request.session[:user_id] = 2
     assert_difference 'Attachment.count', -1 do
       delete :destroy, :id => 3
       assert_response 302
     end
-    set_tmp_attachments_directory
   end
 
   def test_destroy_project_attachment
+    set_tmp_attachments_directory
     @request.session[:user_id] = 2
     assert_difference 'Attachment.count', -1 do
       delete :destroy, :id => 8
       assert_response 302
     end
-    set_tmp_attachments_directory
   end
 
   def test_destroy_version_attachment
+    set_tmp_attachments_directory
     @request.session[:user_id] = 2
     assert_difference 'Attachment.count', -1 do
       delete :destroy, :id => 9
       assert_response 302
     end
-    set_tmp_attachments_directory
   end
 
   def test_destroy_without_permission
+    set_tmp_attachments_directory
     assert_no_difference 'Attachment.count' do
       delete :destroy, :id => 3
     end
     assert_response 302
     assert Attachment.find_by_id(3)
-    set_tmp_attachments_directory
   end
 end