mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Webhooks.
This commit is contained in:
committed by
Guo Xiang Tan
parent
1f70fc9e11
commit
9ce61b4586
30
spec/fabricators/web_hook_fabricator.rb
Normal file
30
spec/fabricators/web_hook_fabricator.rb
Normal file
@@ -0,0 +1,30 @@
|
||||
Fabricator(:web_hook) do
|
||||
payload_url 'https://meta.discourse.org/webhook_listener'
|
||||
content_type WebHook.content_types['application/json']
|
||||
wildcard_web_hook false
|
||||
secret 'my_lovely_secret_for_web_hook'
|
||||
verify_certificate true
|
||||
active true
|
||||
|
||||
transient post_hook: WebHookEventType.find_by(name: 'post')
|
||||
|
||||
after_build do |web_hook, transients|
|
||||
web_hook.web_hook_event_types << transients[:post_hook]
|
||||
end
|
||||
end
|
||||
|
||||
Fabricator(:inactive_web_hook, from: :web_hook) do
|
||||
active false
|
||||
end
|
||||
|
||||
Fabricator(:wildcard_web_hook, from: :web_hook) do
|
||||
wildcard_web_hook true
|
||||
end
|
||||
|
||||
Fabricator(:topic_web_hook, from: :web_hook) do
|
||||
transient topic_hook: WebHookEventType.find_by(name: 'topic')
|
||||
|
||||
after_build do |web_hook, transients|
|
||||
web_hook.web_hook_event_types = [transients[:topic_hook]]
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user