2018-12-13 14:17:19 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :suggestion do
|
2019-10-01 20:06:26 -04:00
|
|
|
relative_order { 0 }
|
2018-12-13 14:17:19 -05:00
|
|
|
association :note, factory: :diff_note_on_merge_request
|
2019-10-01 20:06:26 -04:00
|
|
|
from_content { " vars = {\n" }
|
|
|
|
to_content { " vars = [\n" }
|
2018-12-13 14:17:19 -05:00
|
|
|
|
|
|
|
trait :unappliable do
|
2019-10-01 20:06:26 -04:00
|
|
|
from_content { "foo" }
|
|
|
|
to_content { "foo" }
|
2018-12-13 14:17:19 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
trait :applied do
|
2019-10-01 20:06:26 -04:00
|
|
|
applied { true }
|
2018-12-13 14:17:19 -05:00
|
|
|
commit_id { RepoHelpers.sample_commit.id }
|
|
|
|
end
|
2019-03-15 13:35:34 -04:00
|
|
|
|
|
|
|
trait :content_from_repo do
|
|
|
|
after(:build) do |suggestion, evaluator|
|
|
|
|
suggestion.from_content = suggestion.fetch_from_content
|
|
|
|
end
|
|
|
|
end
|
2018-12-13 14:17:19 -05:00
|
|
|
end
|
|
|
|
end
|