diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-16 21:11:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-16 21:11:26 +0300 |
commit | 8fa0c53e26c947ac647b8067fde3e9673b77b1a6 (patch) | |
tree | da32e7224125973e9e87d3856fb7e672ff41c8b1 /spec/models/group_spec.rb | |
parent | 0552020767452da44de2bf5424096f2cb2ea6bf5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/group_spec.rb')
-rw-r--r-- | spec/models/group_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index c03fcdb6f9c..6ba450b6d57 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -99,6 +99,15 @@ RSpec.describe Group do expect(group).to be_valid end + + it 'does not allow a subgroup to have the same name as an existing subgroup' do + sub_group1 = create(:group, parent: group, name: "SG", path: 'api') + sub_group2 = described_class.new(parent: group, name: "SG", path: 'api2') + + expect(sub_group1).to be_valid + expect(sub_group2).not_to be_valid + expect(sub_group2.errors.full_messages.to_sentence).to eq('Name has already been taken') + end end end |