gitlab-org--gitlab-foss/spec/factories/issues.rb
Jacopo e2056f08f0 Hides Close MR button on merged MR
When a Merge request is merged, shows only the Report abuse menu item
in the dropdown menu instead of showing the close_reopen_report toggle
with an unusable Close button.
The Report abuse is still hidden when the author of the Merge request
is the current_user.

Hides the Reopen button on a closed and locked issue when the
issue.author is not the current_user
2018-10-02 16:17:55 +02:00

38 lines
679 B
Ruby

FactoryBot.define do
factory :issue do
title { generate(:title) }
project
author { project.creator }
updated_by { author }
trait :confidential do
confidential true
end
trait :opened do
state :opened
end
trait :locked do
discussion_locked true
end
trait :closed do
state :closed
closed_at { Time.now }
end
factory :closed_issue, traits: [:closed]
factory :reopened_issue, traits: [:opened]
factory :labeled_issue do
transient do
labels []
end
after(:create) do |issue, evaluator|
issue.update(labels: evaluator.labels)
end
end
end
end