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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
363fa597
Commit
363fa597
authored
Jun 14, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests to make it work with Turbolinks approach
parent
fef47d23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
20 deletions
+23
-20
spec/features/issues/filter_by_labels_spec.rb
spec/features/issues/filter_by_labels_spec.rb
+10
-10
spec/features/issues/filter_issues_spec.rb
spec/features/issues/filter_issues_spec.rb
+13
-10
No files found.
spec/features/issues/filter_by_labels_spec.rb
View file @
363fa597
...
@@ -56,8 +56,9 @@ feature 'Issue filtering by Labels', feature: true do
...
@@ -56,8 +56,9 @@ feature 'Issue filtering by Labels', feature: true do
end
end
it
'should remove label "bug"'
do
it
'should remove label "bug"'
do
first
(
'.js-label-filter-remove'
).
click
find
(
'.js-label-filter-remove'
).
click
expect
(
find
(
'.filtered-labels'
)).
to
have_no_content
"bug"
wait_for_ajax
expect
(
find
(
'.filtered-labels'
,
visible:
false
)).
to
have_no_content
"bug"
end
end
end
end
...
@@ -142,7 +143,8 @@ feature 'Issue filtering by Labels', feature: true do
...
@@ -142,7 +143,8 @@ feature 'Issue filtering by Labels', feature: true do
end
end
it
'should remove label "enhancement"'
do
it
'should remove label "enhancement"'
do
first
(
'.js-label-filter-remove'
).
click
find
(
'.js-label-filter-remove'
,
match: :first
).
click
wait_for_ajax
expect
(
find
(
'.filtered-labels'
)).
to
have_no_content
"enhancement"
expect
(
find
(
'.filtered-labels'
)).
to
have_no_content
"enhancement"
end
end
end
end
...
@@ -179,6 +181,7 @@ feature 'Issue filtering by Labels', feature: true do
...
@@ -179,6 +181,7 @@ feature 'Issue filtering by Labels', feature: true do
before
do
before
do
page
.
within
'.labels-filter'
do
page
.
within
'.labels-filter'
do
click_button
'Label'
click_button
'Label'
wait_for_ajax
click_link
'bug'
click_link
'bug'
find
(
'.dropdown-menu-close'
).
click
find
(
'.dropdown-menu-close'
).
click
end
end
...
@@ -189,14 +192,11 @@ feature 'Issue filtering by Labels', feature: true do
...
@@ -189,14 +192,11 @@ feature 'Issue filtering by Labels', feature: true do
end
end
it
'should allow user to remove filtered labels'
do
it
'should allow user to remove filtered labels'
do
page
.
within
'.filtered-labels'
do
first
(
'.js-label-filter-remove'
).
click
first
(
'.js-label-filter-remove'
).
click
wait_for_ajax
expect
(
page
).
not_to
have_content
'bug'
end
page
.
within
'.labels-filter'
do
expect
(
find
(
'.filtered-labels'
,
visible:
false
)).
not_to
have_content
'bug'
expect
(
page
).
not_to
have_content
'bug'
expect
(
find
(
'.labels-filter'
)).
not_to
have_content
'bug'
end
end
end
end
end
...
...
spec/features/issues/filter_issues_spec.rb
View file @
363fa597
require
'rails_helper'
require
'rails_helper'
describe
'Filter issues'
,
feature:
true
do
describe
'Filter issues'
,
feature:
true
do
include
WaitForAjax
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:user
)
{
create
(
:user
)}
...
@@ -21,7 +22,7 @@ describe 'Filter issues', feature: true do
...
@@ -21,7 +22,7 @@ describe 'Filter issues', feature: true do
find
(
'.dropdown-menu-user-link'
,
text:
user
.
username
).
click
find
(
'.dropdown-menu-user-link'
,
text:
user
.
username
).
click
sleep
2
wait_for_ajax
end
end
context
'assignee'
,
js:
true
do
context
'assignee'
,
js:
true
do
...
@@ -53,7 +54,7 @@ describe 'Filter issues', feature: true do
...
@@ -53,7 +54,7 @@ describe 'Filter issues', feature: true do
find
(
'.milestone-filter .dropdown-content a'
,
text:
milestone
.
title
).
click
find
(
'.milestone-filter .dropdown-content a'
,
text:
milestone
.
title
).
click
sleep
2
wait_for_ajax
end
end
context
'milestone'
,
js:
true
do
context
'milestone'
,
js:
true
do
...
@@ -80,23 +81,21 @@ describe 'Filter issues', feature: true do
...
@@ -80,23 +81,21 @@ describe 'Filter issues', feature: true do
before
do
before
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
find
(
'.js-label-select'
).
click
find
(
'.js-label-select'
).
click
wait_for_ajax
end
end
it
'should filter by any label'
do
it
'should filter by any label'
do
find
(
'.dropdown-menu-labels a'
,
text:
'Any Label'
).
click
find
(
'.dropdown-menu-labels a'
,
text:
'Any Label'
).
click
page
.
first
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
page
.
first
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
sleep
2
wait_for_ajax
page
.
within
'.labels-filter'
do
expect
(
find
(
'.labels-filter'
)).
to
have_content
'Label'
expect
(
page
).
to
have_content
'Any Label'
end
expect
(
find
(
'.js-label-select .dropdown-toggle-text'
)).
to
have_content
(
'Any Label'
)
end
end
it
'should filter by no label'
do
it
'should filter by no label'
do
find
(
'.dropdown-menu-labels a'
,
text:
'No Label'
).
click
find
(
'.dropdown-menu-labels a'
,
text:
'No Label'
).
click
page
.
first
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
page
.
first
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
sleep
2
wait_for_ajax
page
.
within
'.labels-filter'
do
page
.
within
'.labels-filter'
do
expect
(
page
).
to
have_content
'No Label'
expect
(
page
).
to
have_content
'No Label'
...
@@ -122,14 +121,14 @@ describe 'Filter issues', feature: true do
...
@@ -122,14 +121,14 @@ describe 'Filter issues', feature: true do
find
(
'.dropdown-menu-user-link'
,
text:
user
.
username
).
click
find
(
'.dropdown-menu-user-link'
,
text:
user
.
username
).
click
sleep
2
wait_for_ajax
find
(
'.js-label-select'
).
click
find
(
'.js-label-select'
).
click
find
(
'.dropdown-menu-labels .dropdown-content a'
,
text:
label
.
title
).
click
find
(
'.dropdown-menu-labels .dropdown-content a'
,
text:
label
.
title
).
click
page
.
first
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
page
.
first
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
sleep
2
wait_for_ajax
end
end
context
'assignee and label'
,
js:
true
do
context
'assignee and label'
,
js:
true
do
...
@@ -276,9 +275,12 @@ describe 'Filter issues', feature: true do
...
@@ -276,9 +275,12 @@ describe 'Filter issues', feature: true do
it
'should be able to filter and sort issues'
do
it
'should be able to filter and sort issues'
do
click_button
'Label'
click_button
'Label'
wait_for_ajax
page
.
within
'.labels-filter'
do
page
.
within
'.labels-filter'
do
click_link
'bug'
click_link
'bug'
end
end
find
(
'.dropdown-menu-close-icon'
).
click
wait_for_ajax
page
.
within
'.issues-list'
do
page
.
within
'.issues-list'
do
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
...
@@ -288,6 +290,7 @@ describe 'Filter issues', feature: true do
...
@@ -288,6 +290,7 @@ describe 'Filter issues', feature: true do
page
.
within
'.dropdown-menu-sort'
do
page
.
within
'.dropdown-menu-sort'
do
click_link
'Oldest created'
click_link
'Oldest created'
end
end
wait_for_ajax
page
.
within
'.issues-list'
do
page
.
within
'.issues-list'
do
expect
(
first
(
'.issue'
)).
to
have_content
(
'Frontend'
)
expect
(
first
(
'.issue'
)).
to
have_content
(
'Frontend'
)
...
...
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