Merge branch '25031-do-not-raise-error-in-autocomplete' into 'master'
Do not raise error in AutocompleteController#users when not authorized Closes #25031 See merge request !7817
This commit is contained in:
commit
2706550a96
|
@ -11,7 +11,7 @@ class AutocompleteController < ApplicationController
|
|||
@users = @users.reorder(:name)
|
||||
@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])
|
||||
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.size).to eq 0 }
|
||||
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
|
||||
|
||||
context 'author of issuable included' do
|
||||
|
|
Loading…
Reference in New Issue