diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-02-09 18:12:20 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-02-09 18:12:20 +0800 |
commit | 09a3b8fb655ac673a5d706548d13c26cdb53aa9f (patch) | |
tree | 1de0f5552cf1235587cc36f59c1ddc92c1a50752 /spec/models/group_spec.rb | |
parent | 1264e2b6e8ce53f578255e9296875947845431bf (diff) | |
parent | 7534f7a892d6e8c50475720e387b8689c94582da (diff) | |
download | gitlab-ce-09a3b8fb655ac673a5d706548d13c26cdb53aa9f.tar.gz |
Merge remote-tracking branch 'upstream/master' into qa-clone-with-deploy-key
* upstream/master: (466 commits)
Set initial password for instance in LDAP QA test
Backport EE changes to some hashed storage documentation to CE
Remove allow_n_plus_1 from Git::Repository#branches_filter
Bumps Gitlab Shell version to 6.0.3
Make resetting column information overridable in EE
Added 'clear' button to ci lint editor
Issues and merge requests in subgroups docs
Update docs labels CE
Refactored merge_requests/show path in dispatcher.js
wording
don't check against a hardcoded user name
10.5 Update the dependencies license list
10.5 Update the .gitignore, .gitlab-ci.yml, and Dockerfile templates
Create update guide for 10.5
Update 10.5 source install guide
Add docs for MR link in commit page
Add groups to OpenID Connect claims
Replaced $.get with axois.get
Memoize MergeRequest#rebase_in_progress? to prevent N+1 queries in Gitaly
Update style_guide_scss.md
...
Diffstat (limited to 'spec/models/group_spec.rb')
-rw-r--r-- | spec/models/group_spec.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index 5e82a2988ce..338fb314ee9 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -41,7 +41,6 @@ describe Group do describe 'validations' do it { is_expected.to validate_presence_of :name } - it { is_expected.to validate_uniqueness_of(:name).scoped_to(:parent_id) } it { is_expected.to validate_presence_of :path } it { is_expected.not_to validate_presence_of :owner } it { is_expected.to validate_presence_of :two_factor_grace_period } @@ -582,4 +581,20 @@ describe Group do end end end + + describe '#has_parent?' do + context 'when the group has a parent' do + it 'should be truthy' do + group = create(:group, :nested) + expect(group.has_parent?).to be_truthy + end + end + + context 'when the group has no parent' do + it 'should be falsy' do + group = create(:group, parent: nil) + expect(group.has_parent?).to be_falsy + end + end + end end |