Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-27 18:09:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-27 18:09:15 +0300
commit0cbb4a75699e1ab6a0cb704b551e672e09192377 (patch)
tree3464aa858cfe0051bf898c919c097905c9f5f8da /spec/requests
parent507c0e71cd73201beadf9c5e1e0361fc8e9e2665 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/projects_spec.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 4acd0eea448..a2589ef3401 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -3328,8 +3328,8 @@ RSpec.describe API::Projects do
expect(json_response['message']['path']).to eq(['has already been taken'])
end
- it 'accepts a name for the target project' do
- post api("/projects/#{project.id}/fork", user2), params: { name: 'My Random Project' }
+ it 'accepts custom parameters for the target project' do
+ post api("/projects/#{project.id}/fork", user2), params: { name: 'My Random Project', description: 'A description', visibility: 'private' }
expect(response).to have_gitlab_http_status(:created)
expect(json_response['name']).to eq('My Random Project')
@@ -3337,6 +3337,8 @@ RSpec.describe API::Projects do
expect(json_response['owner']['id']).to eq(user2.id)
expect(json_response['namespace']['id']).to eq(user2.namespace.id)
expect(json_response['forked_from_project']['id']).to eq(project.id)
+ expect(json_response['description']).to eq('A description')
+ expect(json_response['visibility']).to eq('private')
expect(json_response['import_status']).to eq('scheduled')
expect(json_response).to include("import_error")
end
@@ -3368,6 +3370,13 @@ RSpec.describe API::Projects do
expect(json_response['message']['path']).to eq(['has already been taken'])
expect(json_response['message']['name']).to eq(['has already been taken'])
end
+
+ it 'fails to fork with an unknown visibility level' do
+ post api("/projects/#{project.id}/fork", user2), params: { visibility: 'something' }
+
+ expect(response).to have_gitlab_http_status(:bad_request)
+ expect(json_response['error']).to eq('visibility does not have a valid value')
+ end
end
context 'when unauthenticated' do