diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/controllers/concerns/lfs_request_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/controllers/concerns/lfs_request_spec.rb')
-rw-r--r-- | spec/controllers/concerns/lfs_request_spec.rb | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/spec/controllers/concerns/lfs_request_spec.rb b/spec/controllers/concerns/lfs_request_spec.rb deleted file mode 100644 index 3bafd761a3e..00000000000 --- a/spec/controllers/concerns/lfs_request_spec.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe LfsRequest do - include ProjectForksHelper - - controller(Repositories::GitHttpClientController) do - # `described_class` is not available in this context - include LfsRequest - - def show - head :ok - end - - def project - @project ||= Project.find_by(id: params[:id]) - end - - def download_request? - true - end - - def upload_request? - false - end - - def ci? - false - end - end - - let(:project) { create(:project, :public) } - - before do - stub_lfs_setting(enabled: true) - end - - context 'user is authenticated without access to lfs' do - before do - allow(controller).to receive(:authenticate_user) - allow(controller).to receive(:authentication_result) do - Gitlab::Auth::Result.new - end - end - - context 'with access to the project' do - it 'returns 403' do - get :show, params: { id: project.id } - - expect(response).to have_gitlab_http_status(:forbidden) - end - end - - context 'without access to the project' do - context 'project does not exist' do - it 'returns 404' do - get :show, params: { id: 'does not exist' } - - expect(response).to have_gitlab_http_status(:not_found) - end - end - - context 'project is private' do - let(:project) { create(:project, :private) } - - it 'returns 404' do - get :show, params: { id: project.id } - - expect(response).to have_gitlab_http_status(:not_found) - end - end - end - end -end |