Merged ajax_upload branch (#3957).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10977 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-12-10 20:09:41 +00:00
parent 2304f5d42c
commit ef25210aca
22 changed files with 442 additions and 83 deletions
+10 -1
View File
@@ -223,12 +223,21 @@ class AttachmentsControllerTest < ActionController::TestCase
set_tmp_attachments_directory
end
def test_show_file_without_container_should_be_denied
def test_show_file_without_container_should_be_allowed_to_author
set_tmp_attachments_directory
attachment = Attachment.create!(:file => uploaded_test_file("testfile.txt", "text/plain"), :author_id => 2)
@request.session[:user_id] = 2
get :show, :id => attachment.id
assert_response 200
end
def test_show_file_without_container_should_be_allowed_to_author
set_tmp_attachments_directory
attachment = Attachment.create!(:file => uploaded_test_file("testfile.txt", "text/plain"), :author_id => 2)
@request.session[:user_id] = 3
get :show, :id => attachment.id
assert_response 403
end