summaryrefslogtreecommitdiff
path: root/spec/services/groups/nested_create_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/groups/nested_create_service_spec.rb')
-rw-r--r--spec/services/groups/nested_create_service_spec.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/services/groups/nested_create_service_spec.rb b/spec/services/groups/nested_create_service_spec.rb
index 6491fb34777..86fdd43c1e5 100644
--- a/spec/services/groups/nested_create_service_spec.rb
+++ b/spec/services/groups/nested_create_service_spec.rb
@@ -59,8 +59,11 @@ describe Groups::NestedCreateService do
describe "#execute" do
it 'returns the group if it already existed' do
- parent = create(:group, path: 'a-group', owner: user)
- child = create(:group, path: 'a-sub-group', parent: parent, owner: user)
+ parent = create(:group, path: 'a-group')
+ child = create(:group, path: 'a-sub-group', parent: parent)
+
+ parent.add_owner(user)
+ child.add_owner(user)
expect(service.execute).to eq(child)
end