2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
FactoryBot.define do
|
2017-08-17 22:00:37 +05:30
|
|
|
factory :timelog do
|
2019-12-21 20:55:43 +05:30
|
|
|
time_spent { 3600 }
|
2021-04-29 21:17:54 +05:30
|
|
|
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
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|