FIX: Do not downcase group name in current user serializer

This commit is contained in:
Penar Musaraj 2020-09-17 13:03:42 -04:00
parent dbdb5b9a47
commit 3d39b4bbb5
No known key found for this signature in database
GPG Key ID: E390435D881FF0F7
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ class CurrentUserSerializer < BasicUserSerializer
:skip_new_user_tips :skip_new_user_tips
def groups def groups
object.visible_groups.pluck(:id, :name).map { |id, name| { id: id, name: name.downcase } } object.visible_groups.pluck(:id, :name).map { |id, name| { id: id, name: name } }
end end
def link_posting_access def link_posting_access

View File

@ -128,7 +128,7 @@ RSpec.describe CurrentUserSerializer do
it "should only show visible groups" do it "should only show visible groups" do
Fabricate.build(:group, visibility_level: Group.visibility_levels[:public]) Fabricate.build(:group, visibility_level: Group.visibility_levels[:public])
hidden_group = Fabricate.build(:group, visibility_level: Group.visibility_levels[:owners]) hidden_group = Fabricate.build(:group, visibility_level: Group.visibility_levels[:owners])
public_group = Fabricate.build(:group, visibility_level: Group.visibility_levels[:public]) public_group = Fabricate.build(:group, visibility_level: Group.visibility_levels[:public], name: "UppercaseGroupName")
hidden_group.add(member) hidden_group.add(member)
hidden_group.save! hidden_group.save!
public_group.add(member) public_group.add(member)