mirror of
https://github.com/discourse/discourse.git
synced 2025-06-19 05:37:59 +08:00
FIX: doesn't translate group permission keys
This commit is contained in:
21
spec/serializers/tag_group_serializer_spec.rb
Normal file
21
spec/serializers/tag_group_serializer_spec.rb
Normal file
@ -0,0 +1,21 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe TagGroupSerializer do
|
||||
|
||||
it "doesn't translate automatic group names in permissions" do
|
||||
staff_group = Group.find(Group::AUTO_GROUPS[:staff])
|
||||
staff_group.update_columns(name: "custom")
|
||||
|
||||
tag_group = Fabricate(:tag_group)
|
||||
tag_group.permissions = [[
|
||||
Group::AUTO_GROUPS[:staff],
|
||||
TagGroupPermission.permission_types[:full]
|
||||
]]
|
||||
tag_group.save!
|
||||
|
||||
serialized = TagGroupSerializer.new(tag_group, root: false).as_json
|
||||
|
||||
expect(serialized[:permissions].keys).to contain_exactly("staff")
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user