debian-mirror-gitlab/spec/factories/suggestions.rb

27 lines
578 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# 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
2019-07-07 11:18:12 +05:30
trait :content_from_repo do
after(:build) do |suggestion, evaluator|
suggestion.from_content = suggestion.fetch_from_content
end
end
2019-02-15 15:39:39 +05:30
end
end