Do not raise error in AutocompleteController#users when not authorized
https://gitlab.com/gitlab-org/gitlab-ce/issues/25031
This commit is contained in:
parent
4a3a413161
commit
f5e8337c7b
|
|
@ -11,7 +11,7 @@ class AutocompleteController < ApplicationController
|
||||||
@users = @users.reorder(:name)
|
@users = @users.reorder(:name)
|
||||||
@users = @users.page(params[:page])
|
@users = @users.page(params[:page])
|
||||||
|
|
||||||
if params[:todo_filter].present?
|
if params[:todo_filter].present? && current_user
|
||||||
@users = @users.todo_authors(current_user.id, params[:todo_state_filter])
|
@users = @users.todo_authors(current_user.id, params[:todo_state_filter])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Do not raise error in AutocompleteController#users when not authorized
|
||||||
|
merge_request: 7817
|
||||||
|
author: Semyon Pupkov
|
||||||
|
|
@ -144,6 +144,15 @@ describe AutocompleteController do
|
||||||
it { expect(body).to be_kind_of(Array) }
|
it { expect(body).to be_kind_of(Array) }
|
||||||
it { expect(body.size).to eq 0 }
|
it { expect(body.size).to eq 0 }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'GET #users with todo filter' do
|
||||||
|
it 'gives an array of users' do
|
||||||
|
get :users, todo_filter: true
|
||||||
|
|
||||||
|
expect(response.status).to eq 200
|
||||||
|
expect(body).to be_kind_of(Array)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'author of issuable included' do
|
context 'author of issuable included' do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue