diff options
author | Alexander Randa <randa.alex@gmail.com> | 2017-07-20 15:12:06 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-07-20 15:12:06 +0000 |
commit | e0ab5618a0998175df9f90c95ebd35d7afa01db7 (patch) | |
tree | 91cfff5c3c9f6a118d69df5e2816b7461ce2ccc5 /app/controllers/admin | |
parent | 020b6a0be06614815d96854084f3dcafeefcf0b7 (diff) | |
download | gitlab-ce-e0ab5618a0998175df9f90c95ebd35d7afa01db7.tar.gz |
Wrong data type when testing webhooks
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/hook_logs_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/admin/hooks_controller.rb | 15 |
2 files changed, 4 insertions, 15 deletions
diff --git a/app/controllers/admin/hook_logs_controller.rb b/app/controllers/admin/hook_logs_controller.rb index aa069b89563..3017f96c26f 100644 --- a/app/controllers/admin/hook_logs_controller.rb +++ b/app/controllers/admin/hook_logs_controller.rb @@ -10,9 +10,9 @@ class Admin::HookLogsController < Admin::ApplicationController end def retry - status, message = hook.execute(hook_log.request_data, hook_log.trigger) + result = hook.execute(hook_log.request_data, hook_log.trigger) - set_hook_execution_notice(status, message) + set_hook_execution_notice(result) redirect_to edit_admin_hook_path(@hook) end diff --git a/app/controllers/admin/hooks_controller.rb b/app/controllers/admin/hooks_controller.rb index 054c3500b35..77e3c95d197 100644 --- a/app/controllers/admin/hooks_controller.rb +++ b/app/controllers/admin/hooks_controller.rb @@ -38,9 +38,9 @@ class Admin::HooksController < Admin::ApplicationController end def test - status, message = hook.execute(sample_hook_data, 'system_hooks') + result = TestHooks::SystemService.new(hook, current_user, params[:trigger]).execute - set_hook_execution_notice(status, message) + set_hook_execution_notice(result) redirect_back_or_default end @@ -66,15 +66,4 @@ class Admin::HooksController < Admin::ApplicationController :url ) end - - def sample_hook_data - { - event_name: "project_create", - name: "Ruby", - path: "ruby", - project_id: 1, - owner_name: "Someone", - owner_email: "example@gitlabhq.com" - } - end end |