debian-mirror-gitlab/spec/factories/resource_state_events.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
280 B
Ruby
Raw Normal View History

2020-05-24 23:13:21 +05:30
# frozen_string_literal: true
FactoryBot.define do
factory :resource_state_event do
2021-01-29 00:20:46 +05:30
issue { merge_request.nil? ? association(:issue) : nil }
2020-05-24 23:13:21 +05:30
merge_request { nil }
state { :opened }
2021-01-29 00:20:46 +05:30
user { issue&.author || merge_request&.author || association(:user) }
2020-05-24 23:13:21 +05:30
end
end