Better handling of attachments when issue validation fails (#10253).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8891 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-02-16 21:00:11 +00:00
parent a8f98bb749
commit d4e6355eb3
11 changed files with 265 additions and 49 deletions

View File

@@ -210,6 +210,14 @@ class AttachmentsControllerTest < ActionController::TestCase
set_tmp_attachments_directory
end
def test_show_file_without_container_should_be_denied
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 403
end
def test_download_text_file
get :download, :id => 4
assert_response :success