Commit d7010fdc authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Create nested group factory

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent b552a4eb
...@@ -19,5 +19,9 @@ FactoryGirl.define do ...@@ -19,5 +19,9 @@ FactoryGirl.define do
trait :access_requestable do trait :access_requestable do
request_access_enabled true request_access_enabled true
end end
trait :nested do
parent factory: :group
end
end end
end end
...@@ -271,4 +271,11 @@ describe Group, models: true do ...@@ -271,4 +271,11 @@ describe Group, models: true do
expect(group.web_url).to include("groups/#{group.name}") expect(group.web_url).to include("groups/#{group.name}")
end end
end end
describe 'nested group' do
subject { create(:group, :nested) }
it { is_expected.to be_valid }
it { expect(subject.parent).to be_kind_of(Group) }
end
end end
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