diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-12-13 20:27:08 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-12-13 20:27:08 +0200 |
commit | f8a17a383562a1ce623e64d7b5f2902052432b2f (patch) | |
tree | 8f2f3b787ab5620490ca969b3dd7a0493128b03d | |
parent | 78115dc13af2b72d87ddbe2c5e42b24d75cd1b17 (diff) | |
download | gitlab-ce-f8a17a383562a1ce623e64d7b5f2902052432b2f.tar.gz |
Add tests for Namespace#full_name method
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | spec/models/namespace_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index 265ffc330e3..90e8f6b7227 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -133,6 +133,14 @@ describe Namespace, models: true do it { expect(nested_group.full_path).to eq("#{group.path}/#{nested_group.path}") } end + describe '#full_name' do + let(:group) { create(:group) } + let(:nested_group) { create(:group, parent: group) } + + it { expect(group.full_name).to eq(group.name) } + it { expect(nested_group.full_name).to eq("#{group.name} / #{nested_group.name}") } + end + describe '#parents' do let(:group) { create(:group) } let(:nested_group) { create(:group, parent: group) } |