FIX: Use same limit as default for user search (#437)

This commit is contained in:
Bianca Nenciu 2023-01-26 16:28:30 +02:00 committed by GitHub
parent f34bc92b40
commit a9b44a973c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -289,7 +289,7 @@ module DiscourseAssign
.where("ucf.name is NULL") .where("ucf.name is NULL")
.assign_allowed .assign_allowed
.order("X.last_assigned DESC") .order("X.last_assigned DESC")
.limit(6) .limit(5)
end end
end end
end end

View File

@ -98,13 +98,13 @@ RSpec.describe DiscourseAssign::AssignController do
describe "#suggestions" do describe "#suggestions" do
before { sign_in(user) } before { sign_in(user) }
it "suggests the current user + the last 6 previously assigned users" do it "suggests the current user + the last 5 previously assigned users" do
assignees = 10.times.map { |_| assign_user_to_post.username } assignees = 10.times.map { |_| assign_user_to_post.username }
get "/assign/suggestions.json" get "/assign/suggestions.json"
suggestions = response.parsed_body["suggestions"].map { |u| u["username"] } suggestions = response.parsed_body["suggestions"].map { |u| u["username"] }
expect(suggestions).to contain_exactly(user.username, *assignees[4..9]) expect(suggestions).to contain_exactly(user.username, *assignees[5..9])
end end
it "doesn't suggest users on holiday" do it "doesn't suggest users on holiday" do