diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-14 06:09:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-14 06:09:17 +0300 |
commit | c69e4aa48c55a413b1ae0a7cc2f3537e3bdcdbbd (patch) | |
tree | 3940e30b133af16fa91e0b624c45c3298f71fea9 /spec/factories | |
parent | 804348d39bc1815441c6c4d901a2cf32d5136f9a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/events.rb | 2 | ||||
-rw-r--r-- | spec/factories/issues.rb | 12 | ||||
-rw-r--r-- | spec/factories/work_items.rb | 11 | ||||
-rw-r--r-- | spec/factories/work_items/work_item_types.rb | 5 |
4 files changed, 14 insertions, 16 deletions
diff --git a/spec/factories/events.rb b/spec/factories/events.rb index 0f564afe822..2a09c385d66 100644 --- a/spec/factories/events.rb +++ b/spec/factories/events.rb @@ -55,7 +55,7 @@ FactoryBot.define do end trait :for_issue do - target { association(:issue, issue_type: :issue) } + target { association(:issue) } target_type { 'Issue' } end diff --git a/spec/factories/issues.rb b/spec/factories/issues.rb index 67824a10288..062e5294e4f 100644 --- a/spec/factories/issues.rb +++ b/spec/factories/issues.rb @@ -8,7 +8,6 @@ FactoryBot.define do author { project.creator } updated_by { author } relative_position { RelativePositioning::START_POSITION } - issue_type { :issue } association :work_item_type, :default trait :confidential do @@ -66,38 +65,35 @@ FactoryBot.define do end end + trait :issue do + association :work_item_type, :default, :issue + end + trait :requirement do - issue_type { :requirement } association :work_item_type, :default, :requirement end trait :task do - issue_type { :task } association :work_item_type, :default, :task end trait :objective do - issue_type { :objective } association :work_item_type, :default, :objective end trait :key_result do - issue_type { :key_result } association :work_item_type, :default, :key_result end trait :incident do - issue_type { :incident } association :work_item_type, :default, :incident end trait :test_case do - issue_type { :test_case } association :work_item_type, :default, :test_case end factory :incident do - issue_type { :incident } association :work_item_type, :default, :incident # An escalation status record is created for all incidents diff --git a/spec/factories/work_items.rb b/spec/factories/work_items.rb index 10764457d84..1e47dc0e348 100644 --- a/spec/factories/work_items.rb +++ b/spec/factories/work_items.rb @@ -7,7 +7,6 @@ FactoryBot.define do author { project.creator } updated_by { author } relative_position { RelativePositioning::START_POSITION } - issue_type { :issue } association :work_item_type, :default trait :confidential do @@ -27,23 +26,23 @@ FactoryBot.define do closed_at { Time.now } end + trait :issue do + association :work_item_type, :default, :issue + end + trait :task do - issue_type { :task } association :work_item_type, :default, :task end trait :incident do - issue_type { :incident } association :work_item_type, :default, :incident end trait :requirement do - issue_type { :requirement } association :work_item_type, :default, :requirement end trait :test_case do - issue_type { :test_case } association :work_item_type, :default, :test_case end @@ -52,12 +51,10 @@ FactoryBot.define do end trait :objective do - issue_type { :objective } association :work_item_type, :default, :objective end trait :key_result do - issue_type { :key_result } association :work_item_type, :default, :key_result end diff --git a/spec/factories/work_items/work_item_types.rb b/spec/factories/work_items/work_item_types.rb index d36cb6260c6..899d4297fec 100644 --- a/spec/factories/work_items/work_item_types.rb +++ b/spec/factories/work_items/work_item_types.rb @@ -23,6 +23,11 @@ FactoryBot.define do namespace { nil } end + trait :issue do + base_type { WorkItems::Type.base_types[:issue] } + icon_name { 'issue-type-issue' } + end + trait :incident do base_type { WorkItems::Type.base_types[:incident] } icon_name { 'issue-type-incident' } |