summaryrefslogtreecommitdiff
path: root/spec/factories/issues.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-18 11:11:44 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-18 11:11:44 +0000
commit25989ab7ef1a444ed2abd5479f176d58e1d9462a (patch)
tree271bb24f3c7178f320cb9de0be0833a285327d09 /spec/factories/issues.rb
parent9bbb32b29703f3ce33dd35d5101145774b793a6d (diff)
downloadgitlab-ce-25989ab7ef1a444ed2abd5479f176d58e1d9462a.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories/issues.rb')
-rw-r--r--spec/factories/issues.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/factories/issues.rb b/spec/factories/issues.rb
index 70f480a3bcb..46910078ee5 100644
--- a/spec/factories/issues.rb
+++ b/spec/factories/issues.rb
@@ -12,7 +12,7 @@ FactoryBot.define do
end
trait :opened do
- state { :opened }
+ state_id { Issue.available_states[:opened] }
end
trait :locked do
@@ -20,10 +20,14 @@ FactoryBot.define do
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]