Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
f6dd6e56
Commit
f6dd6e56
authored
Dec 20, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add image_diff_note_on_merge_request factory
parent
f7ac8041
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
spec/factories/notes.rb
spec/factories/notes.rb
+15
-0
spec/models/diff_note_spec.rb
spec/models/diff_note_spec.rb
+1
-16
No files found.
spec/factories/notes.rb
View file @
f6dd6e56
...
@@ -64,6 +64,21 @@ FactoryBot.define do
...
@@ -64,6 +64,21 @@ FactoryBot.define do
resolved_at
{
Time
.
now
}
resolved_at
{
Time
.
now
}
resolved_by
{
create
(
:user
)
}
resolved_by
{
create
(
:user
)
}
end
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
end
factory
:diff_note_on_commit
,
traits:
[
:on_commit
],
class:
DiffNote
do
factory
:diff_note_on_commit
,
traits:
[
:on_commit
],
class:
DiffNote
do
...
...
spec/models/diff_note_spec.rb
View file @
f6dd6e56
...
@@ -337,24 +337,9 @@ describe DiffNote do
...
@@ -337,24 +337,9 @@ describe DiffNote do
end
end
describe
"image diff notes"
do
describe
"image diff notes"
do
let
(
:path
)
{
"files/images/any_image.png"
}
subject
{
build
(
:image_diff_note_on_merge_request
,
project:
project
,
noteable:
merge_request
)
}
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
describe
"validations"
do
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
{
is_expected
.
not_to
validate_presence_of
(
:line_code
)
}
it
"does not validate diff line"
do
it
"does not validate diff line"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment