Commit 03fa7834 authored by Małgorzata Ksionek's avatar Małgorzata Ksionek

Add cr remarks

parent e285fb50
......@@ -96,20 +96,12 @@ describe 'Private Group access' do
describe 'GET /groups/:path for shared projects' do
let(:project) { create(:project, :public) }
let(:linking_user) { create(:user) }
before do
group.add_guest(linking_user)
Projects::GroupLinks::CreateService.new(
project,
linking_user,
link_group_access: ProjectGroupLink::DEVELOPER
).execute(group)
create(:project_group_link, project: project, group: group)
end
subject { group_path(group) }
it { expect(group.shared_projects).not_to be_empty }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:owner).of(group) }
it { is_expected.to be_allowed_for(:maintainer).of(group) }
......
......@@ -76,23 +76,13 @@ describe GroupPolicy do
context 'with no user and public project' do
let(:project) { create(:project, :public) }
let(:user) { create(:user) }
let(:current_user) { nil }
before do
group.add_developer(user)
Projects::GroupLinks::CreateService.new(
project,
user,
link_group_access: ProjectGroupLink::DEVELOPER
).execute(group)
create(:project_group_link, project: project, group: group)
end
it do
expect(group.shared_projects).not_to be_empty
expect_disallowed(:read_group)
end
it { expect_disallowed(:read_group) }
end
context 'with foreign user and public project' do
......@@ -101,19 +91,10 @@ describe GroupPolicy do
let(:current_user) { create(:user) }
before do
group.add_developer(user)
Projects::GroupLinks::CreateService.new(
project,
user,
link_group_access: ProjectGroupLink::DEVELOPER
).execute(group)
create(:project_group_link, project: project, group: group)
end
it do
expect(group.shared_projects).not_to be_empty
expect_disallowed(:read_group)
end
it { expect_disallowed(:read_group) }
end
context 'has projects' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment