diff options
author | Manoj MJ <mmj@gitlab.com> | 2019-08-31 00:30:51 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-08-31 00:30:51 +0300 |
commit | b943baa42a5365bd6377022223f66db9af58da33 (patch) | |
tree | 60baf4cdcce1176d6a92ede78000a42e3d46d288 /spec/factories | |
parent | 663b7bb4771f3261d7451b6e1d74c778fd0e3589 (diff) |
Limit access request email to 10 most recently active owners/maintainers
This change limits the number of emails
for new access requests notifications to
10 most recently active owners/maintainers
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/group_members.rb | 4 | ||||
-rw-r--r-- | spec/factories/project_members.rb | 4 | ||||
-rw-r--r-- | spec/factories/users.rb | 8 |
3 files changed, 16 insertions, 0 deletions
diff --git a/spec/factories/group_members.rb b/spec/factories/group_members.rb index 4c875935d82..a93f13395a2 100644 --- a/spec/factories/group_members.rb +++ b/spec/factories/group_members.rb @@ -24,5 +24,9 @@ FactoryBot.define do trait(:ldap) do ldap true end + + trait :blocked do + after(:build) { |group_member, _| group_member.user.block! } + end end end diff --git a/spec/factories/project_members.rb b/spec/factories/project_members.rb index 6dcac0400ca..723fa6058fe 100644 --- a/spec/factories/project_members.rb +++ b/spec/factories/project_members.rb @@ -17,5 +17,9 @@ FactoryBot.define do invite_token 'xxx' invite_email 'email@email.com' end + + trait :blocked do + after(:build) { |project_member, _| project_member.user.block! } + end end end diff --git a/spec/factories/users.rb b/spec/factories/users.rb index b2c8bdab013..57e58513529 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -39,6 +39,14 @@ FactoryBot.define do avatar { fixture_file_upload('spec/fixtures/dk.png') } end + trait :with_sign_ins do + sign_in_count 3 + current_sign_in_at { Time.now } + last_sign_in_at { FFaker::Time.between(10.days.ago, 1.day.ago) } + current_sign_in_ip '127.0.0.1' + last_sign_in_ip '127.0.0.1' + end + trait :two_factor_via_otp do before(:create) do |user| user.otp_required_for_login = true |