Commit 00b198bb18843edbf560a5216dcaa1f3816c4815

Authored by Heitor
1 parent f585ae1e

Add git lab hook route to config#routes.rb

Signed off by: Eduardo Araújo <duduktamg@hotmail.com>
config/routes.rb
... ... @@ -14,6 +14,7 @@ Rails.application.routes.draw do
14 14 put '/repositories/:id' => 'repositories#update', as: :repository_update
15 15 # 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
16 16 get '/repositories/:id/process' => 'repositories#process_repository', as: :repository_process
  17 + post '/repositories/:id/notify_push' => 'repositories#notify_push', as: :repository_notify_push
17 18  
18 19 get '/repository_branches' => 'repositories#branches', as: :repository_branches
19 20  
... ...
spec/routing/repositories_routing_spec.rb
... ... @@ -30,5 +30,7 @@ describe RepositoriesController, :type =&gt; :routing do
30 30 to(controller: :repositories, action: :new, project_id: 1) }
31 31 it { is_expected.to route(:post, '/projects/1/repositories').
32 32 to(controller: :repositories, action: :create, project_id: 1) }
  33 + it { is_expected.to route(:post, '/repositories/1/notify_push').
  34 + to(controller: :repositories, action: :notify_push, id: 1) }
33 35 end
34 36 end
... ...