diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/factories/notes.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/factories/notes.rb')
-rw-r--r-- | spec/factories/notes.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/spec/factories/notes.rb b/spec/factories/notes.rb index 4b1f3194ce5..299d08972b7 100644 --- a/spec/factories/notes.rb +++ b/spec/factories/notes.rb @@ -8,7 +8,7 @@ FactoryBot.define do factory :note do project note { generate(:title) } - author { project&.creator || create(:user) } + author { project&.creator || association(:user) } on_issue factory :note_on_commit, traits: [:on_commit] @@ -55,7 +55,7 @@ FactoryBot.define do end position do - build(:text_diff_position, + association(:text_diff_position, file: "files/ruby/popen.rb", old_line: nil, new_line: line_number, @@ -64,7 +64,7 @@ FactoryBot.define do trait :folded_position do position do - build(:text_diff_position, + association(:text_diff_position, file: "files/ruby/popen.rb", old_line: 1, new_line: 1, @@ -74,7 +74,7 @@ FactoryBot.define do factory :image_diff_note_on_merge_request do position do - build(:image_diff_position, + association(:image_diff_position, file: "files/images/any_image.png", diff_refs: diff_refs) end @@ -90,7 +90,7 @@ FactoryBot.define do end position do - build(:text_diff_position, + association(:text_diff_position, file: "files/ruby/popen.rb", old_line: nil, new_line: line_number, @@ -100,7 +100,11 @@ FactoryBot.define do end factory :diff_note_on_design, parent: :note, traits: [:on_design], class: 'DiffNote' do - position { build(:image_diff_position, file: noteable.full_path, diff_refs: noteable.diff_refs) } + position do + association(:image_diff_position, + file: noteable.full_path, + diff_refs: noteable.diff_refs) + end end trait :on_commit do |