2019-04-29 19:27:42 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-15 12:49:57 -05:00
|
|
|
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
|
2017-03-16 01:44:09 -05:00
|
|
|
|
2018-05-18 02:01:36 -05:00
|
|
|
Fabricator(:post_web_hook, from: :web_hook) do
|
|
|
|
transient topic_hook: WebHookEventType.find_by(name: 'post')
|
|
|
|
|
|
|
|
after_build do |web_hook, transients|
|
|
|
|
web_hook.web_hook_event_types = [transients[:post_hook]]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-03-16 01:44:09 -05:00
|
|
|
Fabricator(:user_web_hook, from: :web_hook) do
|
|
|
|
transient user_hook: WebHookEventType.find_by(name: 'user')
|
|
|
|
|
|
|
|
after_build do |web_hook, transients|
|
|
|
|
web_hook.web_hook_event_types = [transients[:user_hook]]
|
|
|
|
end
|
|
|
|
end
|
2018-03-28 07:10:29 -05:00
|
|
|
|
|
|
|
Fabricator(:group_web_hook, from: :web_hook) do
|
|
|
|
transient group_hook: WebHookEventType.find_by(name: 'group')
|
|
|
|
|
|
|
|
after_build do |web_hook, transients|
|
|
|
|
web_hook.web_hook_event_types = [transients[:group_hook]]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:category_web_hook, from: :web_hook) do
|
|
|
|
transient category_hook: WebHookEventType.find_by(name: 'category')
|
|
|
|
|
|
|
|
after_build do |web_hook, transients|
|
|
|
|
web_hook.web_hook_event_types = [transients[:category_hook]]
|
|
|
|
end
|
|
|
|
end
|
2018-04-04 07:19:20 -05:00
|
|
|
|
|
|
|
Fabricator(:tag_web_hook, from: :web_hook) do
|
|
|
|
transient tag_hook: WebHookEventType.find_by(name: 'tag')
|
|
|
|
|
|
|
|
after_build do |web_hook, transients|
|
|
|
|
web_hook.web_hook_event_types = [transients[:tag_hook]]
|
|
|
|
end
|
|
|
|
end
|
2018-04-11 09:17:05 -05:00
|
|
|
|
2019-01-03 11:03:01 -06:00
|
|
|
Fabricator(:reviewable_web_hook, from: :web_hook) do
|
|
|
|
transient reviewable_hook: WebHookEventType.find_by(name: 'reviewable')
|
|
|
|
|
|
|
|
after_build do |web_hook, transients|
|
|
|
|
web_hook.web_hook_event_types = [transients[:reviewable_hook]]
|
|
|
|
end
|
|
|
|
end
|
2019-08-15 13:45:30 -05:00
|
|
|
|
|
|
|
Fabricator(:notification_web_hook, from: :web_hook) do
|
|
|
|
transient notification_hook: WebHookEventType.find_by(name: 'notification')
|
|
|
|
|
|
|
|
after_build do |web_hook, transients|
|
|
|
|
web_hook.web_hook_event_types = [transients[:notification_hook]]
|
|
|
|
end
|
|
|
|
end
|
2020-04-08 13:34:35 -05:00
|
|
|
|
|
|
|
Fabricator(:user_badge_web_hook, from: :web_hook) do
|
|
|
|
transient user_badge_hook: WebHookEventType.find_by(name: 'user_badge')
|
|
|
|
|
|
|
|
after_build do |web_hook, transients|
|
|
|
|
web_hook.web_hook_event_types = [transients[:user_badge_hook]]
|
|
|
|
end
|
|
|
|
end
|
2021-04-08 10:46:34 -05:00
|
|
|
|
|
|
|
Fabricator(:group_user_web_hook, from: :web_hook) do
|
|
|
|
transient group_user_hook: WebHookEventType.find_by(name: 'group_user')
|
|
|
|
|
|
|
|
after_build do |web_hook, transients|
|
|
|
|
web_hook.web_hook_event_types = [transients[:group_user_hook]]
|
|
|
|
end
|
|
|
|
end
|
2021-04-30 19:08:38 -05:00
|
|
|
|
|
|
|
Fabricator(:like_web_hook, from: :web_hook) do
|
|
|
|
transient like_hook: WebHookEventType.find_by(name: 'like')
|
|
|
|
|
|
|
|
after_build do |web_hook, transients|
|
|
|
|
web_hook.web_hook_event_types = [transients[:like_hook]]
|
|
|
|
end
|
|
|
|
end
|