diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-10 23:36:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-10 23:36:29 +0300 |
commit | 1eef146c2d1de19d4e995d421e5787053e50db80 (patch) | |
tree | 2761efabea712248557826977a849e31e3fdb961 /spec/requests/projects_controller_spec.rb | |
parent | 661d663ab2b7c69977ba8a0db02ef4afc2427e39 (diff) |
Add latest changes from gitlab-org/security/gitlab@14-6-stable-ee
Diffstat (limited to 'spec/requests/projects_controller_spec.rb')
-rw-r--r-- | spec/requests/projects_controller_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/requests/projects_controller_spec.rb b/spec/requests/projects_controller_spec.rb new file mode 100644 index 00000000000..d2200d5a4ec --- /dev/null +++ b/spec/requests/projects_controller_spec.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe ProjectsController do + context 'token authentication' do + context 'when public project' do + let_it_be(:public_project) { create(:project, :public) } + + it_behaves_like 'authenticates sessionless user for the request spec', 'show atom', public_resource: true do + let(:url) { project_url(public_project, format: :atom) } + end + end + + context 'when private project' do + let_it_be(:private_project) { create(:project, :private) } + + it_behaves_like 'authenticates sessionless user for the request spec', 'show atom', public_resource: false, ignore_metrics: true do + let(:url) { project_url(private_project, format: :atom) } + + before do + private_project.add_maintainer(user) + end + end + end + end +end |