mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 13:03:39 +08:00
FIX: Missing Group#bio_raw
attribute for group owners.
https://meta.discourse.org/t/group-description-does-not-load-in-editor-for-owners-who-are-not-staff/85345
This commit is contained in:
parent
45cfb61af1
commit
64a45b0980
|
@ -47,7 +47,7 @@ class BasicGroupSerializer < ApplicationSerializer
|
|||
end
|
||||
|
||||
def include_bio_raw?
|
||||
staff?
|
||||
staff? || is_group_owner
|
||||
end
|
||||
|
||||
def include_is_group_user?
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe BasicGroupSerializer do
|
||||
let(:guardian) { Guardian.new }
|
||||
let(:group) { Fabricate(:group) }
|
||||
subject { described_class.new(group, scope: Guardian.new, root: false) }
|
||||
|
||||
describe '#display_name' do
|
||||
|
@ -20,4 +22,22 @@ describe BasicGroupSerializer do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#bio_raw' do
|
||||
let(:group) { Fabricate(:group, bio_raw: 'testing') }
|
||||
|
||||
let(:user) do
|
||||
user = Fabricate(:user)
|
||||
group.add_owner(user)
|
||||
user
|
||||
end
|
||||
|
||||
let(:guardian) { Guardian.new(user) }
|
||||
|
||||
describe 'group owner' do
|
||||
it 'should include bio_raw' do
|
||||
expect(subject.bio_raw).to eq('testing')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user