summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorJan <king-jan1999@hotmail.de>2018-03-26 09:22:03 +0000
committerDouwe Maan <douwe@gitlab.com>2018-03-26 09:22:03 +0000
commit54baf3a362e853f3d704b6936fb7a2c4aebd5956 (patch)
treea27b51b35411c887d8d5965f533fd83444a1d9b9 /spec/requests
parentbf2727564800adc5b2a7c31a7e8241a392fc673d (diff)
downloadgitlab-ce-54baf3a362e853f3d704b6936fb7a2c4aebd5956.tar.gz
Resolve "Forking with namespace doesn't work (API)"
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/projects_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index cee93f6ed14..d73a42f48ad 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -1718,6 +1718,12 @@ describe API::Projects do
group
end
+ let(:group3) do
+ group = create(:group, name: 'group3_name', parent: group2)
+ group.add_owner(user2)
+ group
+ end
+
before do
project.add_reporter(user2)
end
@@ -1813,6 +1819,15 @@ describe API::Projects do
expect(json_response['namespace']['name']).to eq(group2.name)
end
+ it 'forks to owned subgroup' do
+ full_path = "#{group2.path}/#{group3.path}"
+ post api("/projects/#{project.id}/fork", user2), namespace: full_path
+
+ expect(response).to have_gitlab_http_status(201)
+ expect(json_response['namespace']['name']).to eq(group3.name)
+ expect(json_response['namespace']['full_path']).to eq(full_path)
+ end
+
it 'fails to fork to not owned group' do
post api("/projects/#{project.id}/fork", user2), namespace: group.name