FIX: User created web hook being enqueued before record has been saved.

* Improve web hook tests as well.
This commit is contained in:
Guo Xiang Tan
2017-03-16 14:44:09 +08:00
parent bb85795934
commit bf78c228f4
6 changed files with 104 additions and 28 deletions

View File

@@ -28,3 +28,11 @@ Fabricator(:topic_web_hook, from: :web_hook) do
web_hook.web_hook_event_types = [transients[:topic_hook]]
end
end
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