diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-08-12 01:47:26 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-08-12 01:47:26 +0300 |
commit | 1984697b35236cc57638aef2067365c25beb426f (patch) | |
tree | 2ef58ebdc37c33887cc0db82e57f3402547a1bb1 /spec/requests | |
parent | 4ccf39cde7356bf98bef5aae694257fb2c001e75 (diff) | |
parent | ded2b367ad0697765e01796f593493fc4942faeb (diff) |
Merge remote-tracking branch 'origin/master' into improve-pipeline-processing
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/internal_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb index f6f85d6e95e..be52f88831f 100644 --- a/spec/requests/api/internal_spec.rb +++ b/spec/requests/api/internal_spec.rb @@ -275,6 +275,24 @@ describe API::API, api: true do end end + describe 'GET /internal/merge_request_urls' do + let(:repo_name) { "#{project.namespace.name}/#{project.path}" } + let(:changes) { URI.escape("#{Gitlab::Git::BLANK_SHA} 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/new_branch") } + + before do + project.team << [user, :developer] + get api("/internal/merge_request_urls?project=#{repo_name}&changes=#{changes}"), secret_token: secret_token + end + + it 'returns link to create new merge request' do + expect(json_response).to match [{ + "branch_name" => "new_branch", + "url" => "http://localhost/#{project.namespace.name}/#{project.path}/merge_requests/new?merge_request%5Bsource_branch%5D=new_branch", + "new_merge_request" => true + }] + end + end + def pull(key, project, protocol = 'ssh') post( api("/internal/allowed"), |