summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2018-08-09 10:21:17 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2018-08-21 11:23:05 +0200
commit7308a9be1ea480584fad85dc5de569500fc3ceb7 (patch)
treee4a865be06da750f67d4cf73c4cf382356a041b8 /spec/requests
parentcc9764acd049776a40b2188f72436b824f5b0d1a (diff)
downloadgitlab-ce-7308a9be1ea480584fad85dc5de569500fc3ceb7.tar.gz
API: Add shared project's expiration dateapi-shared_group_expires-at
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/projects_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index eb41750bf47..e1b024a39f2 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -914,12 +914,28 @@ describe API::Projects do
expect(json_response['shared_with_groups'][0]['group_id']).to eq(group.id)
expect(json_response['shared_with_groups'][0]['group_name']).to eq(group.name)
expect(json_response['shared_with_groups'][0]['group_access_level']).to eq(link.group_access)
+ expect(json_response['shared_with_groups'][0]['expires_at']).to be_nil
expect(json_response['only_allow_merge_if_pipeline_succeeds']).to eq(project.only_allow_merge_if_pipeline_succeeds)
expect(json_response['only_allow_merge_if_all_discussions_are_resolved']).to eq(project.only_allow_merge_if_all_discussions_are_resolved)
expect(json_response['merge_method']).to eq(project.merge_method.to_s)
expect(json_response['readme_url']).to eq(project.readme_url)
end
+ it 'returns a group link with expiration date' do
+ group = create(:group)
+ expires_at = 5.days.from_now.to_date
+ link = create(:project_group_link, project: project, group: group, expires_at: expires_at)
+
+ get api("/projects/#{project.id}", user)
+
+ expect(json_response['shared_with_groups']).to be_an Array
+ expect(json_response['shared_with_groups'].length).to eq(1)
+ expect(json_response['shared_with_groups'][0]['group_id']).to eq(group.id)
+ expect(json_response['shared_with_groups'][0]['group_name']).to eq(group.name)
+ expect(json_response['shared_with_groups'][0]['group_access_level']).to eq(link.group_access)
+ expect(json_response['shared_with_groups'][0]['expires_at']).to eq(expires_at.to_s)
+ end
+
it 'returns a project by path name' do
get api("/projects/#{project.id}", user)
expect(response).to have_gitlab_http_status(200)