gitlab-org--gitlab-foss/spec/factories/merge_requests.rb
James Lopez a0101ebf84 Update occurrences of MWBS to MWPS
Rename column in the database
 Rename fields related to import/export feature
 Rename API endpoints
 Rename documentation links
 Rename the rest of occurrences in the code
 Replace the images that contain the words "build succeeds" and docs referencing to them
 Make sure pipeline is green and nothing is missing.

updated doc images

renamed only_allow_merge_if_build_succeeds in projects and fixed references

more updates

fix some spec failures

fix rubocop offences

fix v3 api spec

fix MR  specs

fixed issues with partials

fix MR spec

fix alignment

add missing v3 to v4 doc

wip - refactor v3 endpoints

fix specs

fix a few typos

fix project specs

copy entities fully to V3

fix  entity error

more fixes

fix failing specs

fixed missing entities in V3 API

remove comment

updated code based on feedback

typo

fix spec
2017-03-01 12:02:02 +01:00

87 lines
2.1 KiB
Ruby

FactoryGirl.define do
factory :merge_request do
title
author
association :source_project, :repository, factory: :project
target_project { source_project }
# $ git log --pretty=oneline feature..master
# 5937ac0a7beb003549fc5fd26fc247adbce4a52e Add submodule from gitlab.com
# 570e7b2abdd848b95f2f578043fc23bd6f6fd24d Change some files
# 6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9 More submodules
# d14d6c0abdd253381df51a723d58691b2ee1ab08 Remove ds_store files
# c1acaa58bbcbc3eafe538cb8274ba387047b69f8 Ignore DS files
#
# See also RepoHelpers.sample_compare
#
source_branch "master"
target_branch "feature"
merge_status "can_be_merged"
trait :with_diffs do
end
trait :without_diffs do
source_branch "improve/awesome"
target_branch "master"
end
trait :conflict do
source_branch "feature_conflict"
target_branch "feature"
end
trait :merged do
state :merged
end
trait :closed do
state :closed
end
trait :reopened do
state :reopened
end
trait :simple do
source_branch "feature"
target_branch "master"
end
trait :rebased do
source_branch "markdown"
target_branch "improve/awesome"
end
trait :diverged do
source_branch "feature"
target_branch "master"
end
trait :merge_when_pipeline_succeeds do
merge_when_pipeline_succeeds true
merge_user author
end
factory :merged_merge_request, traits: [:merged]
factory :closed_merge_request, traits: [:closed]
factory :reopened_merge_request, traits: [:reopened]
factory :merge_request_with_diffs, traits: [:with_diffs]
factory :merge_request_with_diff_notes do
after(:create) do |mr|
create(:diff_note_on_merge_request, noteable: mr, project: mr.source_project)
end
end
factory :labeled_merge_request do
transient do
labels []
end
after(:create) do |merge_request, evaluator|
merge_request.update_attributes(labels: evaluator.labels)
end
end
end
end