Add tests for Namespace#full_name method

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2016-12-13 20:27:08 +02:00
parent 78115dc13a
commit f8a17a3835
No known key found for this signature in database
GPG key ID: 627C5F589F467F17

View file

@ -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) }