gitlab-org--gitlab-foss/spec/factories/suggestions.rb
Oswaldo Ferreira 03e0604d5d Prepare suggestion implementation for multi-line
Adds the groundwork needed in order to persist multi-line suggestions,
while providing the parsing strategy which will be reused for the
**Preview** as well.
2019-03-27 12:26:53 -03:00

26 lines
578 B
Ruby

# frozen_string_literal: true
FactoryBot.define do
factory :suggestion do
relative_order 0
association :note, factory: :diff_note_on_merge_request
from_content " vars = {\n"
to_content " vars = [\n"
trait :unappliable do
from_content "foo"
to_content "foo"
end
trait :applied do
applied true
commit_id { RepoHelpers.sample_commit.id }
end
trait :content_from_repo do
after(:build) do |suggestion, evaluator|
suggestion.from_content = suggestion.fetch_from_content
end
end
end
end