summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-15 08:58:21 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-15 08:58:21 -0800
commit216b2d2a0539c33377a99b7962af94799c0899b7 (patch)
tree61afa2e6d2fb54c6e0301d8adbddad4fbfdffa1b
parente24967ab658724af50b6695ea64277802f3ed40c (diff)
downloadgitlab-ci-216b2d2a0539c33377a99b7962af94799c0899b7.tar.gz
Stub project hook calls
-rw-r--r--spec/support/gitlab_stubs/project_8_hooks.json1
-rw-r--r--spec/support/stub_gitlab_calls.rb9
2 files changed, 10 insertions, 0 deletions
diff --git a/spec/support/gitlab_stubs/project_8_hooks.json b/spec/support/gitlab_stubs/project_8_hooks.json
new file mode 100644
index 0000000..93d5140
--- /dev/null
+++ b/spec/support/gitlab_stubs/project_8_hooks.json
@@ -0,0 +1 @@
+[{}]
diff --git a/spec/support/stub_gitlab_calls.rb b/spec/support/stub_gitlab_calls.rb
index 4b2080a..a0624ab 100644
--- a/spec/support/stub_gitlab_calls.rb
+++ b/spec/support/stub_gitlab_calls.rb
@@ -3,6 +3,7 @@ module StubGitlabCalls
stub_session
stub_user
stub_project_8
+ stub_project_8_hooks
stub_projects
stub_projects_owned
end
@@ -42,6 +43,14 @@ module StubGitlabCalls
to_return(:status => 200, :body => f, :headers => {'Content-Type'=>'application/json'})
end
+ def stub_project_8_hooks
+ f = File.read(Rails.root.join('spec/support/gitlab_stubs/project_8_hooks.json'))
+
+ stub_request(:get, "#{gitlab_url}api/v3/projects/8/hooks.json?private_token=Wvjy2Krpb7y8xi93owUz").
+ with(:headers => {'Content-Type'=>'application/json'}).
+ to_return(:status => 200, :body => f, :headers => {'Content-Type'=>'application/json'})
+ end
+
def stub_projects
f = File.read(Rails.root.join('spec/support/gitlab_stubs/projects.json'))
stub_request(:get, "#{gitlab_url}api/v3/projects.json?archived=false&private_token=Wvjy2Krpb7y8xi93owUz").