Add specs to check sort on custom fields

This commit is contained in:
brrusselburg 2024-11-07 16:27:27 -06:00
parent 1d637c5243
commit 9a66b8d294

View File

@ -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)