diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/factories/alert_management | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) | |
download | gitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/factories/alert_management')
-rw-r--r-- | spec/factories/alert_management/alerts.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/factories/alert_management/alerts.rb b/spec/factories/alert_management/alerts.rb index 01f40a7a465..8724a626d77 100644 --- a/spec/factories/alert_management/alerts.rb +++ b/spec/factories/alert_management/alerts.rb @@ -8,10 +8,23 @@ FactoryBot.define do title { FFaker::Lorem.sentence } started_at { Time.current } + trait :with_validation_errors do + after(:create) do |alert| + too_many_hosts = Array.new(AlertManagement::Alert::HOSTS_MAX_LENGTH + 1) { |_| 'host' } + alert.update_columns(hosts: too_many_hosts) + end + end + trait :with_issue do issue end + trait :with_assignee do |alert| + after(:create) do |alert| + alert.alert_assignees.create(assignee: create(:user)) + end + end + trait :with_fingerprint do fingerprint { SecureRandom.hex } end @@ -70,6 +83,7 @@ FactoryBot.define do trait :all_fields do with_issue + with_assignee with_fingerprint with_service with_monitoring_tool |