FIX: Use same limit as default for user search (#437)
This commit is contained in:
parent
f34bc92b40
commit
a9b44a973c
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue