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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
3410f4b3
Commit
3410f4b3
authored
Jul 01, 2020
by
Eulyeon Ko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve rspec for better organization and speed
parent
84aeaaf3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
16 deletions
+6
-16
ee/spec/features/epics/epic_show_spec.rb
ee/spec/features/epics/epic_show_spec.rb
+6
-16
No files found.
ee/spec/features/epics/epic_show_spec.rb
View file @
3410f4b3
...
...
@@ -10,9 +10,6 @@ RSpec.describe 'Epic show', :js do
let_it_be
(
:label2
)
{
create
(
:group_label
,
group:
group
,
title:
'enhancement'
)
}
let_it_be
(
:label3
)
{
create
(
:group_label
,
group:
group
,
title:
'documentation'
)
}
let_it_be
(
:public_issue
)
{
create
(
:issue
,
project:
public_project
)
}
let_it_be
(
:note_text1
)
{
'Contemnit enim disserendi elegantiam.'
}
let_it_be
(
:note_text2
)
{
'vel illum qui dolorem eum'
}
let_it_be
(
:note_text3
)
{
'fugiat quo voluptas nulla pariatur?'
}
let_it_be
(
:epic_title
)
{
'Sample epic'
}
let_it_be
(
:markdown
)
do
...
...
@@ -141,11 +138,7 @@ RSpec.describe 'Epic show', :js do
end
describe
'Sort dropdown'
do
def
submit_comment
(
text
)
fill_in
'note[note]'
,
with:
text
click_button
'Comment'
wait_for_requests
end
let!
(
:notes
)
{
create_list
(
:note
,
2
,
noteable:
epic
)
}
context
'when sorted by `Oldest first`'
do
it
'shows label `Oldest first`'
do
...
...
@@ -155,11 +148,9 @@ RSpec.describe 'Epic show', :js do
end
it
'shows comments in the correct order'
do
submit_comment
(
note_text1
)
submit_comment
(
note_text2
)
items
=
all
(
'.timeline-entry .timeline-discussion-body p'
)
expect
(
items
[
0
]).
to
have_content
(
note
_text1
)
expect
(
items
[
1
]).
to
have_content
(
note
_text2
)
expect
(
items
[
0
]).
to
have_content
(
note
s
[
0
].
note
)
expect
(
items
[
1
]).
to
have_content
(
note
s
[
1
].
note
)
end
end
...
...
@@ -167,7 +158,6 @@ RSpec.describe 'Epic show', :js do
before
do
page
.
within
(
'[data-testid="sort-discussion-filter"]'
)
do
find
(
'button'
).
click
wait_for_requests
find
(
'.js-newest-first'
).
click
wait_for_requests
end
...
...
@@ -179,10 +169,10 @@ RSpec.describe 'Epic show', :js do
end
end
it
'shows the newly created comment in the top'
do
submit_comment
(
note_text3
)
it
'shows comments in the correct order'
do
items
=
all
(
'.timeline-entry .timeline-discussion-body p'
)
expect
(
items
[
0
]).
to
have_content
(
note_text3
)
expect
(
items
[
0
]).
to
have_content
(
notes
[
1
].
note
)
expect
(
items
[
1
]).
to
have_content
(
notes
[
0
].
note
)
end
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