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/keys.rb')
-rw-r--r--spec/factories/keys.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/factories/keys.rb b/spec/factories/keys.rb
index 6b800e3d790..a7478ce2657 100644
--- a/spec/factories/keys.rb
+++ b/spec/factories/keys.rb
@@ -5,6 +5,16 @@ FactoryBot.define do
title
key { SSHData::PrivateKey::RSA.generate(1024, unsafe_allow_small_key: true).public_key.openssh(comment: 'dummy@gitlab.com') }
+ trait :expired do
+ to_create { |key| key.save!(validate: false) }
+ expires_at { 2.days.ago }
+ end
+
+ trait :expired_today do
+ to_create { |key| key.save!(validate: false) }
+ expires_at { Date.today.beginning_of_day + 3.hours }
+ end
+
factory :key_without_comment do
key { SSHData::PrivateKey::RSA.generate(1024, unsafe_allow_small_key: true).public_key.openssh }
end