2019-07-25 01:11:48 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-12-13 19:13:44 -05:00
|
|
|
FactoryBot.define do
|
2016-12-23 00:44:02 -05:00
|
|
|
factory :timelog do
|
2019-10-01 20:06:26 -04:00
|
|
|
time_spent { 3600 }
|
2021-04-12 08:09:15 -04:00
|
|
|
for_issue
|
|
|
|
|
|
|
|
factory :issue_timelog, traits: [:for_issue]
|
|
|
|
factory :merge_request_timelog, traits: [:for_merge_request]
|
|
|
|
|
|
|
|
trait :for_issue do
|
|
|
|
issue
|
|
|
|
user { issue.author }
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :for_merge_request do
|
|
|
|
merge_request
|
|
|
|
issue { nil }
|
|
|
|
user { merge_request.author }
|
|
|
|
end
|
2016-12-23 00:44:02 -05:00
|
|
|
end
|
|
|
|
end
|