System Hooks: rspec

This commit is contained in:
Valeriy Sizov 2012-07-19 00:24:37 +03:00
parent 655418bed2
commit 86bd11cbd8
4 changed files with 133 additions and 3 deletions

View file

@ -28,9 +28,15 @@ class Admin::HooksController < ApplicationController
def test
@hook = @project.hooks.find(params[:id])
commits = @project.commits(@project.default_branch, nil, 3)
data = @project.post_receive_data(commits.last.id, commits.first.id, "refs/heads/#{@project.default_branch}", current_user)
@hook = SystemHook.find(params[:hook_id])
data = {
event_name: "project_create",
name: "Ruby",
path: "ruby",
project_id: 1,
owner_name: "Someone",
owner_email: "example@gitlabhq.com"
}
@hook.execute(data)
redirect_to :back