diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-09-22 17:31:18 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-09-28 10:12:49 -0300 |
commit | 93d849beaebb00dc4dcb6cb5ffa4721883e0da51 (patch) | |
tree | 65d716820bc07f684e3629ca88815906603dafdb /spec/requests/api/projects_spec.rb | |
parent | 00a7ca746946fe590b077a4d50232aa862282aee (diff) | |
download | gitlab-ce-93d849beaebb00dc4dcb6cb5ffa4721883e0da51.tar.gz |
Expose project share expiration_date field on APIissue_22382
Diffstat (limited to 'spec/requests/api/projects_spec.rb')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 192c7d14c13..4a0d727faea 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -761,13 +761,16 @@ describe API::API, api: true do let(:group) { create(:group) } it "shares project with group" do + expires_at = 10.days.from_now.to_date + expect do - post api("/projects/#{project.id}/share", user), group_id: group.id, group_access: Gitlab::Access::DEVELOPER + post api("/projects/#{project.id}/share", user), group_id: group.id, group_access: Gitlab::Access::DEVELOPER, expires_at: expires_at end.to change { ProjectGroupLink.count }.by(1) expect(response.status).to eq 201 - expect(json_response['group_id']).to eq group.id - expect(json_response['group_access']).to eq Gitlab::Access::DEVELOPER + expect(json_response['group_id']).to eq(group.id) + expect(json_response['group_access']).to eq(Gitlab::Access::DEVELOPER) + expect(json_response['expires_at']).to eq(expires_at.to_s) end it "returns a 400 error when group id is not given" do |