mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 07:37:55 +08:00
FIX: Missing topic edited web hook when publishing a topic.
This commit is contained in:
@ -173,6 +173,24 @@ describe WebHook do
|
||||
payload = JSON.parse(job_args["payload"])
|
||||
expect(payload["id"]).to eq(topic_id)
|
||||
end
|
||||
|
||||
category = Fabricate(:category)
|
||||
|
||||
expect do
|
||||
PostRevisor.new(post, post.topic).revise!(
|
||||
post.user,
|
||||
{
|
||||
category_id: category.id,
|
||||
}
|
||||
)
|
||||
end.to change { Jobs::EmitWebHookEvent.jobs.length }.by(1)
|
||||
|
||||
job_args = Jobs::EmitWebHookEvent.jobs.last["args"].first
|
||||
|
||||
expect(job_args["event_name"]).to eq("topic_edited")
|
||||
payload = JSON.parse(job_args["payload"])
|
||||
expect(payload["id"]).to eq(topic_id)
|
||||
expect(payload["category_id"]).to eq(category.id)
|
||||
end
|
||||
|
||||
describe 'when topic has been deleted' do
|
||||
|
Reference in New Issue
Block a user