Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/namespaces.rb')
-rw-r--r--spec/factories/namespaces.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/factories/namespaces.rb b/spec/factories/namespaces.rb
index 959183f227d..2b3dabc07d8 100644
--- a/spec/factories/namespaces.rb
+++ b/spec/factories/namespaces.rb
@@ -1,12 +1,14 @@
# frozen_string_literal: true
FactoryBot.define do
- factory :namespace do
+ # This factory is called :namespace but actually maps (and always has) to User type
+ # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/74152#note_730034103 for context
+ factory :namespace, class: 'Namespaces::UserNamespace' do
sequence(:name) { |n| "namespace#{n}" }
+ type { Namespaces::UserNamespace.sti_name }
+
path { name.downcase.gsub(/\s/, '_') }
- # TODO: can this be moved into the :user_namespace factory?
- # evaluate in issue https://gitlab.com/gitlab-org/gitlab/-/issues/341070
owner { association(:user, strategy: :build, namespace: instance, username: path) }
trait :with_aggregation_schedule do