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
iv
gitlab-ce
Commits
9e5ac728
Commit
9e5ac728
authored
Dec 09, 2015
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure notes are replaced on a merge request diff when they're updated
parent
9bfd6c44
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
1 deletion
+36
-1
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+1
-1
features/project/merge_requests.feature
features/project/merge_requests.feature
+10
-0
features/steps/project/merge_requests.rb
features/steps/project/merge_requests.rb
+25
-0
No files found.
app/assets/javascripts/notes.js.coffee
View file @
9e5ac728
...
...
@@ -286,7 +286,7 @@ class @Notes
$html
.
find
(
'.js-task-list-container'
).
taskList
(
'enable'
)
# Find the note's `li` element by ID and replace it with the updated HTML
$note_li
=
$
(
"#note_
#{
note
.
id
}
"
)
$note_li
=
$
(
'.note-row-'
+
note
.
id
)
$note_li
.
replaceWith
(
$html
)
###
...
...
features/project/merge_requests.feature
View file @
9e5ac728
...
...
@@ -83,6 +83,16 @@ Feature: Project Merge Requests
And
I switch to the merge request's comments tab
Then
I should see a discussion has started on diff
@javascript
Scenario
:
I
edit a comment on a merge request diff
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
And
I visit merge request page
"Bug NS-05"
And
I click on the Changes tab
And
I leave a comment like
"Line is wrong"
on diff
And
I change the comment
"Line is wrong"
to
"Typo, please fix"
on diff
Then
I should not see a diff comment saying
"Line is wrong"
And
I should see a diff comment saying
"Typo, please fix"
@javascript
Scenario
:
I
comment on a line of a commit in merge request
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
...
...
features/steps/project/merge_requests.rb
View file @
9e5ac728
...
...
@@ -186,6 +186,31 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
leave_comment
"Line is wrong"
end
step
'I change the comment "Line is wrong" to "Typo, please fix" on diff'
do
page
.
within
(
'.diff-file:nth-of-type(5) .note'
)
do
find
(
'.js-note-edit'
).
click
page
.
within
(
'.current-note-edit-form'
,
visible:
true
)
do
fill_in
'note_note'
,
with:
'Typo, please fix'
click_button
'Save Comment'
end
expect
(
page
).
not_to
have_button
'Save Comment'
,
disabled:
true
,
visible:
true
end
end
step
'I should not see a diff comment saying "Line is wrong"'
do
page
.
within
(
'.diff-file:nth-of-type(5) .note'
)
do
expect
(
page
).
not_to
have_visible_content
'Line is wrong'
end
end
step
'I should see a diff comment saying "Typo, please fix"'
do
page
.
within
(
'.diff-file:nth-of-type(5) .note'
)
do
expect
(
page
).
to
have_visible_content
'Typo, please fix'
end
end
step
'I should see a discussion has started on diff'
do
page
.
within
(
".notes .discussion"
)
do
page
.
should
have_content
"
#{
current_user
.
name
}
started a discussion"
...
...
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