merge_request_diff_files.rb 865 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
# frozen_string_literal: true

FactoryBot.define do
  factory :merge_request_diff_file do
    association :merge_request_diff

    relative_order 0
    new_file true
    renamed_file false
    deleted_file false
    too_large false
    a_mode 0
    b_mode 100644
    new_path 'foo'
    old_path 'foo'
    diff ''
    binary false

    trait :new_file do
      relative_order 0
      new_file true
      renamed_file false
      deleted_file false
      too_large false
      a_mode 0
      b_mode 100644
      new_path 'foo'
      old_path 'foo'
      diff ''
      binary false
    end

    trait :renamed_file do
      relative_order 662
      new_file false
      renamed_file true
      deleted_file false
      too_large false
      a_mode 100644
      b_mode 100644
      new_path 'bar'
      old_path 'baz'
      diff ''
      binary false
    end
  end
end