Commit 127b4557 authored by Rémy Coutable's avatar Rémy Coutable

Fix spec/ee/spec/controllers/autocomplete_controller_spec.rb

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 07f37e01
......@@ -32,9 +32,7 @@ class AutocompleteUsersFinder
items = items.where.not(id: skip_users) if skip_users.present?
# EE
items_by_push_ability = load_users_by_push_ability(items)
items = items.page(page).per(per_page) unless items_by_push_ability
# EE
items = load_users_by_push_ability(items) || items.page(page).per(per_page)
if params[:todo_filter].present? && current_user
items = items.todo_authors(current_user.id, params[:todo_state_filter])
......
......@@ -19,7 +19,7 @@ describe AutocompleteController do
get(:users, project_id: project.id, push_code_to_protected_branches: 'true')
end
it 'returns authorized users' do
it 'returns authorized users', :aggregate_failures do
expect(json_response).to be_kind_of(Array)
expect(json_response.size).to eq(1)
expect(json_response.map { |u| u["username"] }).to match_array([user.username])
......@@ -34,7 +34,7 @@ describe AutocompleteController do
get(:users, project_id: project.id, push_code: 'true')
end
it 'returns authorized users' do
it 'returns authorized users', :aggregate_failures do
expect(json_response).to be_kind_of(Array)
expect(json_response.size).to eq(2)
expect(json_response.map { |user| user["username"] }).to match_array([user.username, user2.username])
......@@ -46,7 +46,7 @@ describe AutocompleteController do
get(:users, project_id: project.id, push_code_to_protected_branches: true, current_user: true)
end
it 'returns authorized users' do
it 'returns authorized users', :aggregate_failures do
expect(json_response).to be_kind_of(Array)
expect(json_response.size).to eq(1)
expect(json_response.map { |u| u["username"] }).to match_array([user.username])
......@@ -70,7 +70,7 @@ describe AutocompleteController do
get(:project_groups, project_id: project.id)
end
it 'returns a single group' do
it 'returns a single group', :aggregate_failures do
expect(json_response).to be_kind_of(Array)
expect(json_response.size).to eq(1)
expect(json_response.first.values_at('id', 'name')).to eq [matching_group.id, matching_group.name]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment