2016-02-16 22:55:24 -05:00
|
|
|
FactoryGirl.define do
|
|
|
|
factory :issue do
|
2017-03-23 12:37:14 -04:00
|
|
|
title { generate(:title) }
|
2016-02-16 22:55:24 -05:00
|
|
|
author
|
2017-01-24 20:30:56 -05:00
|
|
|
project factory: :empty_project
|
2016-02-16 22:55:24 -05:00
|
|
|
|
2016-03-17 15:38:51 -04:00
|
|
|
trait :confidential do
|
|
|
|
confidential true
|
|
|
|
end
|
|
|
|
|
2017-04-25 06:36:18 -04:00
|
|
|
trait :opened do
|
|
|
|
state :opened
|
|
|
|
end
|
|
|
|
|
2016-02-16 22:55:24 -05: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 18:45:19 -04:00
|
|
|
|
|
|
|
factory :labeled_issue do
|
|
|
|
transient do
|
|
|
|
labels []
|
|
|
|
end
|
|
|
|
|
|
|
|
after(:create) do |issue, evaluator|
|
|
|
|
issue.update_attributes(labels: evaluator.labels)
|
|
|
|
end
|
|
|
|
end
|
2016-02-16 22:55:24 -05:00
|
|
|
end
|
|
|
|
end
|