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
da6e38a8
Commit
da6e38a8
authored
Mar 04, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tests for comment forms
parent
e033b9a7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+5
-0
app/views/projects/notes/_form.html.haml
app/views/projects/notes/_form.html.haml
+1
-1
features/steps/project/snippets.rb
features/steps/project/snippets.rb
+1
-1
spec/features/notes_on_merge_requests_spec.rb
spec/features/notes_on_merge_requests_spec.rb
+3
-3
No files found.
app/assets/javascripts/notes.js.coffee
View file @
da6e38a8
...
...
@@ -470,6 +470,11 @@ class @Notes
form
.
find
(
"#note_line_code"
).
val
dataHolder
.
data
(
"lineCode"
)
form
.
find
(
"#note_noteable_type"
).
val
dataHolder
.
data
(
"noteableType"
)
form
.
find
(
"#note_noteable_id"
).
val
dataHolder
.
data
(
"noteableId"
)
form
.
find
(
'.js-note-discard'
)
.
show
()
.
removeClass
(
'js-note-discard'
)
.
addClass
(
'js-close-discussion-note-form'
)
.
text
(
form
.
find
(
'.js-close-discussion-note-form'
).
data
(
'cancel-text'
))
@
setupNoteForm
form
form
.
find
(
".js-note-text"
).
focus
()
form
.
addClass
"js-discussion-note-form"
...
...
app/views/projects/notes/_form.html.haml
View file @
da6e38a8
...
...
@@ -15,5 +15,5 @@
.note-form-actions.clearfix
=
f
.
submit
'Comment'
,
class:
"btn btn-nr btn-create comment-btn btn-grouped js-comment-button"
=
yield
(
:note_actions
)
%a
.btn.btn-cancel.js-note-discard
{
role:
"button"
}
%a
.btn.btn-cancel.js-note-discard
{
role:
"button"
,
data:
{
cancel_text:
"Cancel"
}
}
Discard draft
features/steps/project/snippets.rb
View file @
da6e38a8
...
...
@@ -77,7 +77,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
step
'I leave a comment like "Good snippet!"'
do
page
.
within
(
'.js-main-target-form'
)
do
fill_in
"note_note"
,
with:
"Good snippet!"
click_button
"
Add
Comment"
click_button
"Comment"
end
end
...
...
spec/features/notes_on_merge_requests_spec.rb
View file @
da6e38a8
...
...
@@ -22,7 +22,7 @@ describe 'Comments', feature: true do
it
'should be valid'
do
is_expected
.
to
have_css
(
'.js-main-target-form'
,
visible:
true
,
count:
1
)
expect
(
find
(
'.js-main-target-form input[type=submit]'
).
value
).
to
eq
(
'
Add
Comment'
)
to
eq
(
'Comment'
)
page
.
within
(
'.js-main-target-form'
)
do
expect
(
page
).
not_to
have_link
(
'Cancel'
)
end
...
...
@@ -49,7 +49,7 @@ describe 'Comments', feature: true do
page
.
within
(
'.js-main-target-form'
)
do
fill_in
'note[note]'
,
with:
'This is awsome!'
find
(
'.js-md-preview-button'
).
click
click_button
'
Add
Comment'
click_button
'Comment'
end
end
...
...
@@ -202,7 +202,7 @@ describe 'Comments', feature: true do
before
do
page
.
within
(
"tr[id='
#{
line_code_2
}
'] + .js-temp-notes-holder"
)
do
fill_in
'note[note]'
,
with:
'Another comment on line 10'
click_button
(
'
Add
Comment'
)
click_button
(
'Comment'
)
end
end
...
...
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