diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-22 08:26:29 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-22 08:26:29 +0000 |
commit | e922750e89fde40d9f3c465d7b1f380943c464e3 (patch) | |
tree | 32858c902c3f356e0ce89075ad916db3cd4879d4 /spec/requests | |
parent | 1bbe39452664021af90851aef8527ce5e850343e (diff) | |
parent | 7308a9be1ea480584fad85dc5de569500fc3ceb7 (diff) | |
download | gitlab-ce-e922750e89fde40d9f3c465d7b1f380943c464e3.tar.gz |
Merge branch 'api-shared_group_expires-at' into 'master'
API: Add shared project's expiration date
Closes #46107
See merge request gitlab-org/gitlab-ce!21104
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 881eff5d09d..b6f92042ecc 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -913,12 +913,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) |