Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-15 16:38:50 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-15 16:38:50 +0400
commit8bfc62fb8b02bde7da97958deb8aeda63581bfce (patch)
tree1ccb80a7780a4d7b888070c690276bf6271d8989 /app/controllers/projects/hooks_controller.rb
parent37ef33cba18f947699fc3f285397be34861ab51e (diff)
Convert TestHookContext into TestHookService. Added tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/projects/hooks_controller.rb')
-rw-r--r--app/controllers/projects/hooks_controller.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb
index 314d87df034..a863b318324 100644
--- a/app/controllers/projects/hooks_controller.rb
+++ b/app/controllers/projects/hooks_controller.rb
@@ -24,15 +24,20 @@ class Projects::HooksController < Projects::ApplicationController
end
def test
- TestHookContext.new(project, current_user, params).execute
+ TestHookService.new.execute(hook, current_user)
redirect_to :back
end
def destroy
- @hook = @project.hooks.find(params[:id])
- @hook.destroy
+ hook.destroy
redirect_to project_hooks_path(@project)
end
+
+ private
+
+ def hook
+ @hook ||= @project.hooks.find(params[:id])
+ end
end