BigW Consortium Gitlab

merge_requests.rb 1.85 KB
Newer Older
Dmitriy Zaporozhets committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# == Schema Information
#
# Table name: merge_requests
#
#  id                :integer          not null, primary key
#  target_branch     :string(255)      not null
#  source_branch     :string(255)      not null
#  source_project_id :integer          not null
#  author_id         :integer
#  assignee_id       :integer
#  title             :string(255)
#  created_at        :datetime
#  updated_at        :datetime
#  milestone_id      :integer
#  state             :string(255)
#  merge_status      :string(255)
#  target_project_id :integer          not null
#  iid               :integer
#  description       :text
#  position          :integer          default(0)
Dmitriy Zaporozhets committed
21
#  locked_at         :datetime
Dmitriy Zaporozhets committed
22 23
#

24 25 26 27 28 29 30 31 32 33 34 35 36
FactoryGirl.define do
  factory :merge_request do
    title
    author
    source_project 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
37 38 39
    #
    # See also RepoHelpers.sample_compare
    #
40 41 42 43 44 45 46 47
    source_branch "master"
    target_branch "feature"

    merge_status :can_be_merged

    trait :with_diffs do
    end

48 49 50 51 52
    trait :conflict do
      source_branch "feature_conflict"
      target_branch "feature"
    end

53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
    trait :closed do
      state :closed
    end

    trait :reopened do
      state :reopened
    end

    trait :simple do
      source_branch "feature"
      target_branch "master"
    end

    factory :closed_merge_request, traits: [:closed]
    factory :reopened_merge_request, traits: [:reopened]
    factory :merge_request_with_diffs, traits: [:with_diffs]
  end
end