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
a33aacd5
Commit
a33aacd5
authored
Apr 06, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Further fixes for feature spec
parent
1065ba40
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
25 deletions
+30
-25
spec/features/discussion_comments_spec.rb
spec/features/discussion_comments_spec.rb
+30
-25
No files found.
spec/features/discussion_comments_spec.rb
View file @
a33aacd5
...
...
@@ -12,6 +12,34 @@ shared_examples 'discussion comments' do |resource_name|
expect
(
page
).
to
have_selector
toggle_selector
end
it
'"Comment" will post a comment'
do
find
(
"
#{
form_selector
}
.note-textarea"
).
send_keys
(
'a'
)
find
(
submit_selector
).
click
find
(
'.timeline .timeline-entry'
,
match: :first
)
new_comment
=
all
(
'.timeline .timeline-entry'
).
last
expect
(
new_comment
).
to
have_content
'a'
expect
(
new_comment
).
not_to
have_selector
'.discussion'
end
if
resource_name
=~
/(issue|merge request)/
it
"'Comment & close
#{
resource_name
}
' will post a comment and close the
#{
resource_name
}
"
do
find
(
"
#{
form_selector
}
.note-textarea"
).
send_keys
(
'a'
)
find
(
close_selector
).
click
find
(
'.timeline .timeline-entry'
,
match: :first
)
entries
=
all
(
'.timeline .timeline-entry'
)
close_note
=
entries
.
last
new_comment
=
entries
[
-
2
]
expect
(
close_note
).
to
have_content
'closed'
expect
(
new_comment
).
not_to
have_selector
'.discussion'
end
end
describe
'when the toggle is clicked'
do
before
do
find
(
"
#{
form_selector
}
.note-textarea"
).
send_keys
(
'a'
)
...
...
@@ -50,30 +78,6 @@ shared_examples 'discussion comments' do |resource_name|
expect
(
items
.
last
[
'class'
]).
not_to
match
'droplab-item-selected'
end
it
'"Comment" will post a comment'
do
find
(
submit_selector
).
click
find
(
'.timeline .timeline-entry'
,
match: :first
)
new_comment
=
all
(
'.timeline .timeline-entry'
).
last
expect
(
new_comment
).
to
have_content
'a'
expect
(
new_comment
).
not_to
have_selector
'.discussion'
end
if
resource_name
=~
/(issue|merge request)/
it
"Comment & close' will post a comment and close the
#{
resource_name
}
"
do
find
(
close_selector
).
click
find
(
'.timeline .timeline-entry'
,
match: :first
)
entries
=
all
(
'.timeline .timeline-entry'
)
close_note
=
entries
.
last
new_comment
=
entries
[
-
2
]
expect
(
close_note
).
to
have_content
'closed'
expect
(
new_comment
).
not_to
have_selector
'.discussion'
end
end
it
'closes the menu when clicking the toggle'
do
find
(
toggle_selector
).
click
...
...
@@ -121,7 +125,7 @@ shared_examples 'discussion comments' do |resource_name|
end
if
resource_name
=~
/(issue|merge request)/
it
"'Start discussion & close' will post a discussion and close the
#{
resource_name
}
"
do
it
"'Start discussion & close
#{
resource_name
}
' will post a discussion and close the
#{
resource_name
}
"
do
find
(
close_selector
).
click
find
(
'.timeline .timeline-entry'
,
match: :first
)
...
...
@@ -204,6 +208,7 @@ end
describe
'Discussion Comments'
,
:feature
,
:js
do
include
RepoHelpers
include
WaitForAjax
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
...
...
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