Commit f6dd6e56 authored by Douwe Maan's avatar Douwe Maan

Add image_diff_note_on_merge_request factory

parent f7ac8041
......@@ -64,6 +64,21 @@ FactoryBot.define do
resolved_at { Time.now }
resolved_by { create(:user) }
end
factory :image_diff_note_on_merge_request do
position do
Gitlab::Diff::Position.new(
old_path: "files/images/any_image.png",
new_path: "files/images/any_image.png",
width: 10,
height: 10,
x: 1,
y: 1,
diff_refs: diff_refs,
position_type: "image"
)
end
end
end
factory :diff_note_on_commit, traits: [:on_commit], class: DiffNote do
......
......@@ -337,24 +337,9 @@ describe DiffNote do
end
describe "image diff notes" do
let(:path) { "files/images/any_image.png" }
let!(:position) do
Gitlab::Diff::Position.new(
old_path: path,
new_path: path,
width: 10,
height: 10,
x: 1,
y: 1,
diff_refs: merge_request.diff_refs,
position_type: "image"
)
end
subject { build(:image_diff_note_on_merge_request, project: project, noteable: merge_request) }
describe "validations" do
subject { build(:diff_note_on_merge_request, project: project, position: position, noteable: merge_request) }
it { is_expected.not_to validate_presence_of(:line_code) }
it "does not validate diff line" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment