diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-06-17 00:17:20 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-06-17 00:17:20 -0300 |
commit | 33c61bd461d21dbb79db18e0c2424f53120e83c0 (patch) | |
tree | 2b0d60fe8b8a9c132c8c25f63131d333821f876e /spec/requests | |
parent | 24f5f071dcce529a3fbbc887ebce7bfc56353361 (diff) | |
parent | f82ab42d0534950c1ceb458e0152f329df80ae9d (diff) | |
download | gitlab-ce-33c61bd461d21dbb79db18e0c2424f53120e83c0.tar.gz |
Re-use notifications dropdown/modal for user profile
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index f167813e07d..2a2ac8710ee 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -428,8 +428,9 @@ describe API::API, api: true do describe 'permissions' do context 'all projects' do - it 'Contains permission information' do - project.team << [user, :master] + before { project.team << [user, :master] } + + it 'contains permission information' do get api("/projects", user) expect(response.status).to eq(200) @@ -437,10 +438,18 @@ describe API::API, api: true do to eq(Gitlab::Access::MASTER) expect(json_response.first['permissions']['group_access']).to be_nil end + + it 'contains notification level information' do + get api("/projects", user) + + expect(response.status).to eq(200) + expect(json_response.first['permissions']['project_access']['notification_level']['level']).to eq(NotificationSetting.levels[:global]) + expect(json_response.first['permissions']['project_access']['notification_level'].keys).to include('events') + end end context 'personal project' do - it 'Sets project access and returns 200' do + it 'sets project access and returns 200' do project.team << [user, :master] get api("/projects/#{project.id}", user) @@ -452,9 +461,11 @@ describe API::API, api: true do end context 'group project' do + let(:project2) { create(:project, group: create(:group)) } + + before { project2.group.add_owner(user) } + it 'should set the owner and return 200' do - project2 = create(:project, group: create(:group)) - project2.group.add_owner(user) get api("/projects/#{project2.id}", user) expect(response.status).to eq(200) @@ -462,6 +473,14 @@ describe API::API, api: true do expect(json_response['permissions']['group_access']['access_level']). to eq(Gitlab::Access::OWNER) end + + it 'shows notification level information' do + get api("/projects/#{project2.id}", user) + + expect(response.status).to eq(200) + expect(json_response['permissions']['group_access']['notification_level']['level']).to eq(NotificationSetting.levels[:global]) + expect(json_response['permissions']['group_access']['notification_level'].keys).to include('events') + end end end end |