gitlab-org--gitlab-foss/spec/factories/clusters/kubernetes_namespaces.rb
Kamil Trzciński c3bd3bfc6e Improve variables support
This ensures that variables accept only string,
alongside also improves kubernetes_namespace,
improving validation and default value being set.
2018-11-19 14:09:39 +01:00

18 lines
536 B
Ruby

# frozen_string_literal: true
FactoryBot.define do
factory :cluster_kubernetes_namespace, class: Clusters::KubernetesNamespace do
association :cluster, :project, :provided_by_gcp
after(:build) do |kubernetes_namespace|
cluster_project = kubernetes_namespace.cluster.cluster_project
kubernetes_namespace.project = cluster_project.project
kubernetes_namespace.cluster_project = cluster_project
end
trait :with_token do
service_account_token { FFaker::Lorem.characters(10) }
end
end
end