2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-22 15:30:34 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe 'Projects > Members > Group member cannot request access to their group project' do
|
2016-06-22 15:30:34 +05:30
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:group) { create(:group) }
|
|
|
|
let(:project) { create(:project, namespace: group) }
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
it 'owner does not see the request access button' do
|
2016-06-22 15:30:34 +05:30
|
|
|
group.add_owner(user)
|
|
|
|
login_and_visit_project_page(user)
|
|
|
|
|
|
|
|
expect(page).not_to have_content 'Request Access'
|
|
|
|
end
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
it 'maintainer does not see the request access button' do
|
|
|
|
group.add_maintainer(user)
|
2016-06-22 15:30:34 +05:30
|
|
|
login_and_visit_project_page(user)
|
|
|
|
|
|
|
|
expect(page).not_to have_content 'Request Access'
|
|
|
|
end
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
it 'developer does not see the request access button' do
|
2016-06-22 15:30:34 +05:30
|
|
|
group.add_developer(user)
|
|
|
|
login_and_visit_project_page(user)
|
|
|
|
|
|
|
|
expect(page).not_to have_content 'Request Access'
|
|
|
|
end
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
it 'reporter does not see the request access button' do
|
2016-06-22 15:30:34 +05:30
|
|
|
group.add_reporter(user)
|
|
|
|
login_and_visit_project_page(user)
|
|
|
|
|
|
|
|
expect(page).not_to have_content 'Request Access'
|
|
|
|
end
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
it 'guest does not see the request access button' do
|
2016-06-22 15:30:34 +05:30
|
|
|
group.add_guest(user)
|
|
|
|
login_and_visit_project_page(user)
|
|
|
|
|
|
|
|
expect(page).not_to have_content 'Request Access'
|
|
|
|
end
|
|
|
|
|
|
|
|
def login_and_visit_project_page(user)
|
2017-09-10 17:25:29 +05:30
|
|
|
sign_in(user)
|
|
|
|
visit project_path(project)
|
2016-06-22 15:30:34 +05:30
|
|
|
end
|
|
|
|
end
|