mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 10:33:51 +08:00
Add specs to check sort on custom fields
This commit is contained in:
parent
1d637c5243
commit
9a66b8d294
|
@ -245,6 +245,9 @@ RSpec.describe DirectoryItemsController do
|
|||
expect(items.length).to eq(3)
|
||||
expect(json["meta"]["total_rows_directory_items"]).to eq(3)
|
||||
|
||||
names = items.map { |item| item["user"]["username"] }
|
||||
expect(names).to eq(names.sort)
|
||||
|
||||
user_fields.each do |data|
|
||||
user = items[data[:order]]["user"]
|
||||
expect(user["username"]).to eq(data[:user].username)
|
||||
|
|
Loading…
Reference in New Issue
Block a user