summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/gitlab_custom_hook_spec.rb25
1 files changed, 24 insertions, 1 deletions
diff --git a/spec/gitlab_custom_hook_spec.rb b/spec/gitlab_custom_hook_spec.rb
index faa4f2b..5cc9e0b 100644
--- a/spec/gitlab_custom_hook_spec.rb
+++ b/spec/gitlab_custom_hook_spec.rb
@@ -81,9 +81,32 @@ describe GitlabCustomHook do
cleanup_hook_setup
end
- context 'with gl_id_test_hook' do
+ context 'with gl_id_test_hook as repo hook' do
before do
create_repo_hooks(hook_gl_id)
+ end
+
+ context 'pre_receive hook' do
+ it 'passes GL_ID variable to hook' do
+ expect(gitlab_custom_hook.pre_receive(changes)).to eq(true)
+ end
+ end
+
+ context 'post_receive hook' do
+ it 'passes GL_ID variable to hook' do
+ expect(gitlab_custom_hook.post_receive(changes)).to eq(true)
+ end
+ end
+
+ context 'update hook' do
+ it 'passes GL_ID variable to hook' do
+ expect(gitlab_custom_hook.update(ref_name, old_value, new_value)).to eq(true)
+ end
+ end
+ end
+
+ context 'with gl_id_test_hook as global hook' do
+ before do
create_global_hooks_d(hook_gl_id)
end