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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-20 12:09:22 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-20 12:09:22 +0300
commita7608a4940a91e14754d56a7acbe496321fed99c (patch)
treefb661eddbd2d190695050788b7f89168a6f541e3 /spec/factories/clusters
parent7734690def0c885f9f79567185c3dc5df353f9a0 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories/clusters')
-rw-r--r--spec/factories/clusters/agent_tokens.rb9
-rw-r--r--spec/factories/clusters/agents.rb9
2 files changed, 18 insertions, 0 deletions
diff --git a/spec/factories/clusters/agent_tokens.rb b/spec/factories/clusters/agent_tokens.rb
new file mode 100644
index 00000000000..6f92f2217b3
--- /dev/null
+++ b/spec/factories/clusters/agent_tokens.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :cluster_agent_token, class: 'Clusters::AgentToken' do
+ association :agent, factory: :cluster_agent
+
+ token_encrypted { Gitlab::CryptoHelper.aes256_gcm_encrypt(SecureRandom.hex(50)) }
+ end
+end
diff --git a/spec/factories/clusters/agents.rb b/spec/factories/clusters/agents.rb
new file mode 100644
index 00000000000..493b73d1688
--- /dev/null
+++ b/spec/factories/clusters/agents.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :cluster_agent, class: 'Clusters::Agent' do
+ project
+
+ sequence(:name) { |n| "agent_#{n}" }
+ end
+end