diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-02-15 19:33:35 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-02-22 18:55:36 +0100 |
commit | d2e43fbde60589c905aae9d2500c63355ba8fdc4 (patch) | |
tree | 139bda3bb65ab2de1768e34e7bbee52d5028e608 /spec/controllers | |
parent | dd52915dc605071eba17fb3876229d2db54481f6 (diff) | |
download | gitlab-ce-d2e43fbde60589c905aae9d2500c63355ba8fdc4.tar.gz |
Removed pagination from AutocompleteUsersFinder
The frontend code doesn't use this so there's no practical point in
supporting this. We also hardcode the limit to 20 so users can no longer
request their own limit, which could overload the database (depending on
any upper bounds perhaps enforced by Kaminari).
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/autocomplete_controller_spec.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/controllers/autocomplete_controller_spec.rb b/spec/controllers/autocomplete_controller_spec.rb index 73fff6eb5ca..b7257fac608 100644 --- a/spec/controllers/autocomplete_controller_spec.rb +++ b/spec/controllers/autocomplete_controller_spec.rb @@ -109,15 +109,17 @@ describe AutocompleteController do end context 'limited users per page' do - let(:per_page) { 2 } - before do + 25.times do + create(:user) + end + sign_in(user) - get(:users, per_page: per_page) + get(:users) end it { expect(json_response).to be_kind_of(Array) } - it { expect(json_response.size).to eq(per_page) } + it { expect(json_response.size).to eq(20) } end context 'unauthenticated user' do |