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/events.rb')
-rw-r--r--spec/factories/events.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/factories/events.rb b/spec/factories/events.rb
index 403165a3935..a4f06a48621 100644
--- a/spec/factories/events.rb
+++ b/spec/factories/events.rb
@@ -26,10 +26,10 @@ FactoryBot.define do
factory :wiki_page_event do
action { :created }
- # rubocop: disable FactoryBot/InlineAssociation
+ # rubocop: disable RSpec/FactoryBot/InlineAssociation
# A persistent project is needed to have a wiki page being created properly.
project { @overrides[:wiki_page]&.container || create(:project, :wiki_repo) }
- # rubocop: enable FactoryBot/InlineAssociation
+ # rubocop: enable RSpec/FactoryBot/InlineAssociation
target { association(:wiki_page_meta, :for_wiki_page, wiki_page: wiki_page) }
transient do
@@ -54,6 +54,16 @@ FactoryBot.define do
target { note }
end
+ trait :for_issue do
+ target { association(:issue, issue_type: :issue) }
+ target_type { 'Issue' }
+ end
+
+ trait :for_work_item do
+ target { association(:work_item, :task) }
+ target_type { 'WorkItem' }
+ end
+
factory :design_event, traits: [:has_design] do
action { :created }
target { design }