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

37 lines
637 B
Ruby
Raw Normal View History

2016-06-02 11:05:42 +05:30
FactoryGirl.define do
factory :issue do
2017-08-17 22:00:37 +05:30
title { generate(:title) }
2016-06-02 11:05:42 +05:30
author
2017-08-17 22:00:37 +05:30
project factory: :empty_project
2016-06-02 11:05:42 +05:30
trait :confidential do
confidential true
end
2017-08-17 22:00:37 +05:30
trait :opened do
state :opened
end
2016-06-02 11:05:42 +05:30
trait :closed do
state :closed
end
trait :reopened do
state :reopened
end
factory :closed_issue, traits: [:closed]
factory :reopened_issue, traits: [:reopened]
2016-09-13 17:45:13 +05:30
factory :labeled_issue do
transient do
labels []
end
after(:create) do |issue, evaluator|
issue.update_attributes(labels: evaluator.labels)
end
end
2016-06-02 11:05:42 +05:30
end
end