2016-02-17 03:55:24 +00:00
|
|
|
FactoryGirl.define do
|
2016-09-12 13:11:49 +00:00
|
|
|
sequence :issue_created_at do |n|
|
|
|
|
4.hours.ago + ( 2 * n ).seconds
|
|
|
|
end
|
|
|
|
|
2016-02-17 03:55:24 +00:00
|
|
|
factory :issue do
|
|
|
|
title
|
|
|
|
author
|
2017-01-25 01:30:56 +00:00
|
|
|
project factory: :empty_project
|
2016-02-17 03:55:24 +00:00
|
|
|
|
2016-03-17 19:38:51 +00:00
|
|
|
trait :confidential do
|
|
|
|
confidential true
|
|
|
|
end
|
|
|
|
|
2016-02-17 03:55:24 +00:00
|
|
|
trait :closed do
|
|
|
|
state :closed
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :reopened do
|
|
|
|
state :reopened
|
|
|
|
end
|
|
|
|
|
|
|
|
factory :closed_issue, traits: [:closed]
|
|
|
|
factory :reopened_issue, traits: [:reopened]
|
2016-07-20 22:45:19 +00:00
|
|
|
|
|
|
|
factory :labeled_issue do
|
|
|
|
transient do
|
|
|
|
labels []
|
|
|
|
end
|
|
|
|
|
|
|
|
after(:create) do |issue, evaluator|
|
|
|
|
issue.update_attributes(labels: evaluator.labels)
|
|
|
|
end
|
|
|
|
end
|
2016-02-17 03:55:24 +00:00
|
|
|
end
|
|
|
|
end
|