diff options
Diffstat (limited to 'spec/controllers/projects/ci')
-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 |