FIX: Don’t translate TrustLevel name when generating links (#13588)
We want to put the name of the trust level in to generated URLs, not the human-readable form. i.e.: `/admin/users/list/newuser` rather than: `/admin/users/list/new user`
This commit is contained in:
parent
6209b11659
commit
4728962f7d
|
@ -24,7 +24,7 @@ module Reports::UsersByTrustLevel
|
|||
]
|
||||
|
||||
User.real.group('trust_level').count.sort.each do |level, count|
|
||||
key = TrustLevel.name(level.to_i)
|
||||
key = TrustLevel.levels.key(level.to_i)
|
||||
url = Proc.new { |k| "/admin/users/list/#{k}" }
|
||||
report.data << { url: url.call(key), key: key, x: level.to_i, y: count }
|
||||
end
|
||||
|
|
|
@ -352,6 +352,8 @@ describe Report do
|
|||
expect(report.data.find { |d| d[:x] == TrustLevel[0] }[:y]).to eq 3
|
||||
expect(report.data.find { |d| d[:x] == TrustLevel[2] }[:y]).to eq 2
|
||||
expect(report.data.find { |d| d[:x] == TrustLevel[4] }[:y]).to eq 1
|
||||
|
||||
expect(report.data.find { |d| d[:x] == TrustLevel[0] }[:url]).to eq '/admin/users/list/newuser'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue