Commit 4c5efa77 authored by Rémy Coutable's avatar Rémy Coutable

Remove a duplicated spec describe block

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 9ef1d2a7
......@@ -550,118 +550,6 @@ describe Namespace do
end
end
describe '#share_with_group_lock with subgroups', :nested_groups do
context 'when creating a subgroup' do
let(:subgroup) { create(:group, parent: root_group )}
context 'under a parent with "Share with group lock" enabled' do
let(:root_group) { create(:group, share_with_group_lock: true) }
it 'enables "Share with group lock" on the subgroup' do
expect(subgroup.share_with_group_lock).to be_truthy
end
end
context 'under a parent with "Share with group lock" disabled' do
let(:root_group) { create(:group) }
it 'does not enable "Share with group lock" on the subgroup' do
expect(subgroup.share_with_group_lock).to be_falsey
end
end
end
context 'when enabling the parent group "Share with group lock"' do
let(:root_group) { create(:group) }
let!(:subgroup) { create(:group, parent: root_group )}
it 'the subgroup "Share with group lock" becomes enabled' do
root_group.update!(share_with_group_lock: true)
expect(subgroup.reload.share_with_group_lock).to be_truthy
end
end
context 'when disabling the parent group "Share with group lock" (which was already enabled)' do
let(:root_group) { create(:group, share_with_group_lock: true) }
context 'and the subgroup "Share with group lock" is enabled' do
let(:subgroup) { create(:group, parent: root_group, share_with_group_lock: true )}
it 'the subgroup "Share with group lock" does not change' do
root_group.update!(share_with_group_lock: false)
expect(subgroup.reload.share_with_group_lock).to be_truthy
end
end
context 'but the subgroup "Share with group lock" is disabled' do
let(:subgroup) { create(:group, parent: root_group )}
it 'the subgroup "Share with group lock" does not change' do
root_group.update!(share_with_group_lock: false)
expect(subgroup.reload.share_with_group_lock?).to be_falsey
end
end
end
# Note: Group transfers are not yet implemented
context 'when a group is transferred into a root group' do
context 'when the root group "Share with group lock" is enabled' do
let(:root_group) { create(:group, share_with_group_lock: true) }
context 'when the subgroup "Share with group lock" is enabled' do
let(:subgroup) { create(:group, share_with_group_lock: true )}
it 'the subgroup "Share with group lock" does not change' do
subgroup.parent = root_group
subgroup.save!
expect(subgroup.share_with_group_lock).to be_truthy
end
end
context 'when the subgroup "Share with group lock" is disabled' do
let(:subgroup) { create(:group)}
it 'the subgroup "Share with group lock" becomes enabled' do
subgroup.parent = root_group
subgroup.save!
expect(subgroup.share_with_group_lock).to be_truthy
end
end
end
context 'when the root group "Share with group lock" is disabled' do
let(:root_group) { create(:group) }
context 'when the subgroup "Share with group lock" is enabled' do
let(:subgroup) { create(:group, share_with_group_lock: true )}
it 'the subgroup "Share with group lock" does not change' do
subgroup.parent = root_group
subgroup.save!
expect(subgroup.share_with_group_lock).to be_truthy
end
end
context 'when the subgroup "Share with group lock" is disabled' do
let(:subgroup) { create(:group)}
it 'the subgroup "Share with group lock" does not change' do
subgroup.parent = root_group
subgroup.save!
expect(subgroup.share_with_group_lock).to be_falsey
end
end
end
end
end
describe '#find_fork_of?' do
let(:project) { create(:project, :public) }
let!(:forked_project) { fork_project(project, namespace.owner, namespace: namespace) }
......
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