summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/artifacts_controller_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-28 00:06:20 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-28 00:06:20 +0000
commite08eba1838cb749b8815c7da98a504ff97bcfb98 (patch)
tree0172bc4d205f59dd6f3722b27d53e6aa8abb5825 /spec/controllers/projects/artifacts_controller_spec.rb
parentd4633b0e70ec39583ce0b13f277f990b216ac0d9 (diff)
downloadgitlab-ce-e08eba1838cb749b8815c7da98a504ff97bcfb98.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/projects/artifacts_controller_spec.rb')
-rw-r--r--spec/controllers/projects/artifacts_controller_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/controllers/projects/artifacts_controller_spec.rb b/spec/controllers/projects/artifacts_controller_spec.rb
index c0b01e573b2..e42e35bc6e0 100644
--- a/spec/controllers/projects/artifacts_controller_spec.rb
+++ b/spec/controllers/projects/artifacts_controller_spec.rb
@@ -286,6 +286,25 @@ describe Projects::ArtifactsController do
expect(response).to render_template('projects/artifacts/file')
end
end
+
+ context 'when the project is private and pages access control is enabled' do
+ let(:private_project) { create(:project, :repository, :private) }
+ let(:pipeline) { create(:ci_pipeline, project: private_project) }
+ let(:job) { create(:ci_build, :success, :artifacts, pipeline: pipeline) }
+
+ before do
+ private_project.add_developer(user)
+
+ allow(Gitlab.config.pages).to receive(:access_control).and_return(true)
+ allow(Gitlab.config.pages).to receive(:artifacts_server).and_return(true)
+ end
+
+ it 'renders the file view' do
+ get :file, params: { namespace_id: private_project.namespace, project_id: private_project, job_id: job, path: 'ci_artifacts.txt' }
+
+ expect(response).to have_gitlab_http_status(302)
+ end
+ end
end
describe 'GET raw' do