summaryrefslogtreecommitdiff
path: root/spec/requests/api
diff options
context:
space:
mode:
authorDmitry Poray <dmip@interprogma.ru>2016-11-07 20:11:54 +0300
committerDmitry Poray <dmip@interprogma.ru>2016-11-15 17:19:33 +0300
commitff8194e0ec16092419862011d7cc048baa149c42 (patch)
treeeaaf61f02c9c2d59719a3a941463a9ed2a0565f3 /spec/requests/api
parentc5e147de1288130147ec0f500bea50353d441cb8 (diff)
downloadgitlab-ce-ff8194e0ec16092419862011d7cc048baa149c42.tar.gz
Add ref parameter for triggerring builds with gitlab webhook from other project.
Diffstat (limited to 'spec/requests/api')
-rw-r--r--spec/requests/api/triggers_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/requests/api/triggers_spec.rb b/spec/requests/api/triggers_spec.rb
index 8ba2eccf66c..c890a51ae42 100644
--- a/spec/requests/api/triggers_spec.rb
+++ b/spec/requests/api/triggers_spec.rb
@@ -54,6 +54,13 @@ describe API::API do
expect(pipeline.builds.size).to eq(5)
end
+ it 'creates builds on webhook from other gitlab repository and branch' do
+ expect do
+ post api("/projects/#{project.id}/ref/master/trigger/builds?token=#{trigger_token}"), { ref: 'refs/heads/other-branch' }
+ end.to change(project.builds, :count).by(5)
+ expect(response).to have_http_status(201)
+ end
+
it 'returns bad request with no builds created if there\'s no commit for that ref' do
post api("/projects/#{project.id}/trigger/builds"), options.merge(ref: 'other-branch')
expect(response).to have_http_status(400)