diff options
Diffstat (limited to 'spec/factories/issues.rb')
-rw-r--r-- | spec/factories/issues.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/factories/issues.rb b/spec/factories/issues.rb index 434225f7022..46910078ee5 100644 --- a/spec/factories/issues.rb +++ b/spec/factories/issues.rb @@ -8,28 +8,32 @@ FactoryBot.define do updated_by { author } trait :confidential do - confidential true + confidential { true } end trait :opened do - state :opened + state_id { Issue.available_states[:opened] } end trait :locked do - discussion_locked true + discussion_locked { true } end trait :closed do - state :closed + state_id { Issue.available_states[:closed] } closed_at { Time.now } end + after(:build) do |issue, evaluator| + issue.state_id = Issue.available_states[evaluator.state] + end + factory :closed_issue, traits: [:closed] factory :reopened_issue, traits: [:opened] factory :labeled_issue do transient do - labels [] + labels { [] } end after(:create) do |issue, evaluator| |