summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-12-01 15:24:13 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-12-01 15:24:13 +0000
commit36a5a9f9f8461ad750351c33bbc2816c4d320157 (patch)
tree8a323ebf7121613fea0621ed96762b6827715b65 /test
parent072faff556c5f3ab1f65cad4d2753600cf4ee909 (diff)
downloadredmine-36a5a9f9f8461ad750351c33bbc2816c4d320157.tar.gz
redmine-36a5a9f9f8461ad750351c33bbc2816c4d320157.zip
Revert r21976.
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21978 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/attachments_controller_test.rb16
-rw-r--r--test/integration/attachments_test.rb52
2 files changed, 1 insertions, 67 deletions
diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb
index 5c8d72b90..7b0ded8f9 100644
--- a/test/functional/attachments_controller_test.rb
+++ b/test/functional/attachments_controller_test.rb
@@ -623,22 +623,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
assert_response 404
end
- def test_download_all_with_invisible_journal
- Project.find(1).update_column :is_public, false
- Member.delete_all
- @request.session[:user_id] = 2
- User.current = User.find(2)
- assert_not Journal.find(3).journalized.visible?
- get(
- :download_all,
- :params => {
- :object_type => 'journals',
- :object_id => '3'
- }
- )
- assert_response 403
- end
-
def test_download_all_with_maximum_bulk_download_size_larger_than_attachments
with_settings :bulk_download_max_size => 0 do
@request.session[:user_id] = 2
diff --git a/test/integration/attachments_test.rb b/test/integration/attachments_test.rb
index ab07f3a31..197eda6aa 100644
--- a/test/integration/attachments_test.rb
+++ b/test/integration/attachments_test.rb
@@ -25,9 +25,7 @@ class AttachmentsTest < Redmine::IntegrationTest
:roles, :members, :member_roles,
:trackers, :projects_trackers,
:issues, :issue_statuses, :enumerations,
- :attachments,
- :wiki_content_versions, :wiki_contents, :wiki_pages,
- :journals, :journal_details
+ :attachments
def test_upload_should_set_default_content_type
log_user('jsmith', 'jsmith')
@@ -225,54 +223,6 @@ class AttachmentsTest < Redmine::IntegrationTest
set_tmp_attachments_directory
end
- def test_download_all_with_wrong_container_type
- set_tmp_attachments_directory
-
- # make the attachment readable
- assert a = Attachment.find(3)
- FileUtils.mkdir_p File.dirname(a.diskfile)
- (File.open(a.diskfile, 'wb') << 'test').close
-
- # there is no 'download all' for WikiContentVersions
- with_settings :login_required => '0' do
- get "/attachments/wiki_content_versions/7/download"
- assert_response :not_found
- end
- with_settings :login_required => '1' do
- get "/attachments/wiki_content_versions/7/download"
- assert_response :not_found
- end
- end
-
- def test_download_all_for_journal_should_check_visibility
- set_tmp_attachments_directory
- Project.find(1).update_column :is_public, false
-
- # make the attachment readable
- assert a = Attachment.find(4)
- FileUtils.mkdir_p File.dirname(a.diskfile)
- (File.open(a.diskfile, 'wb') << 'test').close
-
- with_settings :login_required => '0' do
- get "/attachments/journals/3/download"
- assert_response 403
- end
- with_settings :login_required => '1' do
- get "/attachments/journals/3/download"
- assert_redirected_to "/login?back_url=http%3A%2F%2Fwww.example.com%2Fattachments%2Fjournals%2F3%2Fdownload"
- end
-
- Project.find(1).update_column :is_public, true
- with_settings :login_required => '0' do
- get "/attachments/journals/3/download"
- assert_response :success
- end
- with_settings :login_required => '1' do
- get "/attachments/journals/3/download"
- assert_redirected_to "/login?back_url=http%3A%2F%2Fwww.example.com%2Fattachments%2Fjournals%2F3%2Fdownload"
- end
- end
-
private
def ajax_upload(filename, content, attachment_id=1)