mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 10:42:45 +08:00
Add category id to webhook post serializer
This commit is contained in:
parent
c6e336b519
commit
0a492829ea
|
@ -15,6 +15,10 @@ class WebHookPostSerializer < PostSerializer
|
|||
true
|
||||
end
|
||||
|
||||
def include_category_id?
|
||||
true
|
||||
end
|
||||
|
||||
%i{
|
||||
can_view
|
||||
can_edit
|
||||
|
|
|
@ -12,7 +12,7 @@ RSpec.describe WebHookPostSerializer do
|
|||
|
||||
it 'should only include the required keys' do
|
||||
count = serialized_for_user(admin).keys.count
|
||||
difference = count - 41
|
||||
difference = count - 42
|
||||
|
||||
expect(difference).to eq(0), lambda {
|
||||
message = +""
|
||||
|
@ -27,6 +27,10 @@ RSpec.describe WebHookPostSerializer do
|
|||
}
|
||||
end
|
||||
|
||||
it "includes category_id" do
|
||||
expect(serialized_for_user(admin)[:category_id]).to eq(post.topic.category_id)
|
||||
end
|
||||
|
||||
it 'should only include deleted topic title for staffs' do
|
||||
topic = post.topic
|
||||
PostDestroyer.new(Discourse.system_user, post).destroy
|
||||
|
|
Loading…
Reference in New Issue
Block a user