From 00b198bb18843edbf560a5216dcaa1f3816c4815 Mon Sep 17 00:00:00 2001 From: Heitor Reis Date: Wed, 18 Nov 2015 14:46:00 -0200 Subject: [PATCH] Add git lab hook route to config#routes.rb --- config/routes.rb | 1 + spec/routing/repositories_routing_spec.rb | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 5a9ebfe..6e7a85c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -14,6 +14,7 @@ Rails.application.routes.draw do put '/repositories/:id' => 'repositories#update', as: :repository_update # This route should be a POST to be semantically correct. But, RepositoriesController#create relies on a redirect to it which is not possible with a POST get '/repositories/:id/process' => 'repositories#process_repository', as: :repository_process + post '/repositories/:id/notify_push' => 'repositories#notify_push', as: :repository_notify_push get '/repository_branches' => 'repositories#branches', as: :repository_branches diff --git a/spec/routing/repositories_routing_spec.rb b/spec/routing/repositories_routing_spec.rb index bd96633..5868642 100644 --- a/spec/routing/repositories_routing_spec.rb +++ b/spec/routing/repositories_routing_spec.rb @@ -30,5 +30,7 @@ describe RepositoriesController, :type => :routing do to(controller: :repositories, action: :new, project_id: 1) } it { is_expected.to route(:post, '/projects/1/repositories'). to(controller: :repositories, action: :create, project_id: 1) } + it { is_expected.to route(:post, '/repositories/1/notify_push'). + to(controller: :repositories, action: :notify_push, id: 1) } end end -- libgit2 0.21.2