diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /spec/controllers/projects/feature_flags_user_lists_controller_spec.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/controllers/projects/feature_flags_user_lists_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/feature_flags_user_lists_controller_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/controllers/projects/feature_flags_user_lists_controller_spec.rb b/spec/controllers/projects/feature_flags_user_lists_controller_spec.rb index e0d1d3765b2..32817f048e6 100644 --- a/spec/controllers/projects/feature_flags_user_lists_controller_spec.rb +++ b/spec/controllers/projects/feature_flags_user_lists_controller_spec.rb @@ -16,6 +16,39 @@ RSpec.describe Projects::FeatureFlagsUserListsController do { namespace_id: project.namespace, project_id: project }.merge(extra_params) end + describe 'GET #index' do + it 'redirects when the user is unauthenticated' do + get(:index, params: request_params) + + expect(response).to redirect_to(new_user_session_path) + end + + it 'returns not found if the user does not belong to the project' do + user = create(:user) + sign_in(user) + + get(:index, params: request_params) + + expect(response).to have_gitlab_http_status(:not_found) + end + + it 'returns not found for a reporter' do + sign_in(reporter) + + get(:index, params: request_params) + + expect(response).to have_gitlab_http_status(:not_found) + end + + it 'renders the new page for a developer' do + sign_in(developer) + + get(:index, params: request_params) + + expect(response).to have_gitlab_http_status(:ok) + end + end + describe 'GET #new' do it 'redirects when the user is unauthenticated' do get(:new, params: request_params) |