diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/controllers/projects/ci/secure_files_controller_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/controllers/projects/ci/secure_files_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/ci/secure_files_controller_spec.rb | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/spec/controllers/projects/ci/secure_files_controller_spec.rb b/spec/controllers/projects/ci/secure_files_controller_spec.rb index 1138897bcc6..200997e31b9 100644 --- a/spec/controllers/projects/ci/secure_files_controller_spec.rb +++ b/spec/controllers/projects/ci/secure_files_controller_spec.rb @@ -9,17 +9,35 @@ RSpec.describe Projects::Ci::SecureFilesController do subject(:show_request) { get :show, params: { namespace_id: project.namespace, project_id: project } } describe 'GET #show' do - context 'with enough privileges' do - before do - sign_in(user) - project.add_developer(user) - show_request + context 'when the :ci_secure_files feature flag is enabled' do + context 'with enough privileges' do + before do + stub_feature_flags(ci_secure_files: true) + sign_in(user) + project.add_developer(user) + show_request + end + + it { expect(response).to have_gitlab_http_status(:ok) } + + it 'renders show page' do + expect(response).to render_template :show + end end + end - it { expect(response).to have_gitlab_http_status(:ok) } + context 'when the :ci_secure_files feature flag is disabled' do + context 'with enough privileges' do + before do + stub_feature_flags(ci_secure_files: false) + sign_in(user) + project.add_developer(user) + show_request + end - it 'renders show page' do - expect(response).to render_template :show + it 'responds with 404' do + expect(response).to have_gitlab_http_status(:not_found) + end end end |