From ab286656b22dd686a659afe908daade6e5a54ff3 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Mon, 23 Apr 2018 15:48:26 +0000 Subject: Resolve "Namespace factory is problematic" --- spec/factories/groups.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec/factories/groups.rb') diff --git a/spec/factories/groups.rb b/spec/factories/groups.rb index 8c531cf5909..3b354c0d96b 100644 --- a/spec/factories/groups.rb +++ b/spec/factories/groups.rb @@ -5,6 +5,14 @@ FactoryBot.define do type 'Group' owner nil + after(:create) do |group| + if group.owner + # We could remove this after we have proper constraint: + # https://gitlab.com/gitlab-org/gitlab-ce/issues/43292 + raise "Don't set owner for groups, use `group.add_owner(user)` instead" + end + end + trait :public do visibility_level Gitlab::VisibilityLevel::PUBLIC end -- cgit v1.2.1