Spec test to make sure we do not skip trashed post
This commit is contained in:
parent
cc3cf6588b
commit
e924de71e7
|
@ -67,6 +67,16 @@ describe Jobs::EmitWebHookEvent do
|
|||
end.not_to raise_error
|
||||
end
|
||||
|
||||
it 'should not skip trashed post' do
|
||||
stub_request(:post, "https://meta.discourse.org/webhook_listener")
|
||||
.to_return(body: 'OK', status: 200)
|
||||
|
||||
expect do
|
||||
post.trash!
|
||||
subject.execute(web_hook_id: post_hook.id, event_type: 'post', post_id: post.id)
|
||||
end.to change(WebHookEvent, :count).by(1)
|
||||
end
|
||||
|
||||
it 'sets up proper request headers' do
|
||||
stub_request(:post, "https://meta.discourse.org/webhook_listener")
|
||||
.to_return(headers: { test: 'string' }, body: 'OK', status: 200)
|
||||
|
|
Loading…
Reference in New Issue