diff options
author | Alexander Randa <randa.alex@gmail.com> | 2017-07-20 18:12:06 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-07-20 18:12:06 +0300 |
commit | e0ab5618a0998175df9f90c95ebd35d7afa01db7 (patch) | |
tree | 91cfff5c3c9f6a118d69df5e2816b7461ce2ccc5 /app/controllers/projects/hooks_controller.rb | |
parent | 020b6a0be06614815d96854084f3dcafeefcf0b7 (diff) |
Wrong data type when testing webhooks
Diffstat (limited to 'app/controllers/projects/hooks_controller.rb')
-rw-r--r-- | app/controllers/projects/hooks_controller.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb index 18895c3f0f3..85d35900c71 100644 --- a/app/controllers/projects/hooks_controller.rb +++ b/app/controllers/projects/hooks_controller.rb @@ -9,6 +9,10 @@ class Projects::HooksController < Projects::ApplicationController layout "project_settings" + def index + redirect_to project_settings_integrations_path(@project) + end + def create @hook = @project.hooks.new(hook_params) @hook.save @@ -33,13 +37,9 @@ class Projects::HooksController < Projects::ApplicationController end def test - if !@project.empty_repo? - status, message = TestHookService.new.execute(hook, current_user) + result = TestHooks::ProjectService.new(hook, current_user, params[:trigger]).execute - set_hook_execution_notice(status, message) - else - flash[:alert] = 'Hook execution failed. Ensure the project has commits.' - end + set_hook_execution_notice(result) redirect_back_or_default(default: { action: 'index' }) end |