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/models/deploy_token_spec.rb')
-rw-r--r--spec/models/deploy_token_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/deploy_token_spec.rb b/spec/models/deploy_token_spec.rb
index 1b8dd62455e..36479dffe21 100644
--- a/spec/models/deploy_token_spec.rb
+++ b/spec/models/deploy_token_spec.rb
@@ -473,4 +473,12 @@ RSpec.describe DeployToken, feature_category: :continuous_delivery do
expect(subject.impersonated?).to be(false)
end
end
+
+ describe '.token' do
+ # Specify a blank token_encrypted so that the model's method is used
+ # instead of the factory value
+ subject(:plaintext) { create(:deploy_token, token_encrypted: nil).token }
+
+ it { is_expected.to match(/gldt-[A-Za-z0-9_-]{20}/) }
+ end
end