mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 23:39:32 +08:00
FIX: Show user filter hints when typing @
in search (#13799)
Will show the last 6 seen users as filtering suggestions when typing @ in quick search. (Previously the user suggestion required a character after the @.) This also adds a default limit of 6 to the user search query, previously the backend was returning 20 results but a maximum of 6 results was being shown anyway.
This commit is contained in:
@ -4022,6 +4022,24 @@ describe UsersController do
|
||||
expect(json["users"].map { |u| u["name"] }).not_to include(staged_user.name)
|
||||
end
|
||||
end
|
||||
|
||||
context '`last_seen_users`' do
|
||||
it "returns results when the param is true" do
|
||||
get "/u/search/users.json", params: { last_seen_users: true }
|
||||
|
||||
json = response.parsed_body
|
||||
expect(json["users"]).not_to be_empty
|
||||
end
|
||||
|
||||
it "respects limit parameter at the same time" do
|
||||
limit = 3
|
||||
get "/u/search/users.json", params: { last_seen_users: true, limit: limit }
|
||||
|
||||
json = response.parsed_body
|
||||
expect(json["users"]).not_to be_empty
|
||||
expect(json["users"].size).to eq(limit)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#email_login' do
|
||||
|
Reference in New Issue
Block a user