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
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-02 03:11:26 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-02 03:11:26 +0300
commit30b8ad35feb7efb0587f44d8e7b371490634ee1c (patch)
treeebd11699a7e27c6e01aaa8d9ba72e64fe356ae61 /spec
parent11b7785066d3e81916cbf653f4eb6568148f7e01 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/clusters/agent_tokens.rb2
-rw-r--r--spec/models/clusters/agent_token_spec.rb2
2 files changed, 4 insertions, 0 deletions
diff --git a/spec/factories/clusters/agent_tokens.rb b/spec/factories/clusters/agent_tokens.rb
index 6f92f2217b3..c49d197c3cd 100644
--- a/spec/factories/clusters/agent_tokens.rb
+++ b/spec/factories/clusters/agent_tokens.rb
@@ -5,5 +5,7 @@ FactoryBot.define do
association :agent, factory: :cluster_agent
token_encrypted { Gitlab::CryptoHelper.aes256_gcm_encrypt(SecureRandom.hex(50)) }
+
+ sequence(:name) { |n| "agent-token-#{n}" }
end
end
diff --git a/spec/models/clusters/agent_token_spec.rb b/spec/models/clusters/agent_token_spec.rb
index 8107b5b1388..a1b45df1970 100644
--- a/spec/models/clusters/agent_token_spec.rb
+++ b/spec/models/clusters/agent_token_spec.rb
@@ -6,6 +6,8 @@ RSpec.describe Clusters::AgentToken do
it { is_expected.to belong_to(:agent).class_name('Clusters::Agent').required }
it { is_expected.to belong_to(:created_by_user).class_name('User').optional }
it { is_expected.to validate_length_of(:description).is_at_most(1024) }
+ it { is_expected.to validate_length_of(:name).is_at_most(255) }
+ it { is_expected.to validate_presence_of(:name) }
describe '#token' do
it 'is generated on save' do