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
c7f74256
Commit
c7f74256
authored
Sep 07, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simulate filtering with url params, clean up accordingly.
parent
a329763d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
44 deletions
+7
-44
spec/features/issues/reset_filters_spec.rb
spec/features/issues/reset_filters_spec.rb
+7
-44
No files found.
spec/features/issues/reset_filters_spec.rb
View file @
c7f74256
...
@@ -2,6 +2,7 @@ require 'rails_helper'
...
@@ -2,6 +2,7 @@ require 'rails_helper'
feature
'Issues filter reset button'
,
feature:
true
,
js:
true
do
feature
'Issues filter reset button'
,
feature:
true
,
js:
true
do
include
WaitForAjax
include
WaitForAjax
include
IssueHelpers
let!
(
:project
)
{
create
(
:project
,
:public
)
}
let!
(
:project
)
{
create
(
:project
,
:public
)
}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:user
)
{
create
(
:user
)}
...
@@ -12,12 +13,11 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -12,12 +13,11 @@ feature 'Issues filter reset button', feature: true, js: true do
before
do
before
do
project
.
team
<<
[
user
,
:developer
]
project
.
team
<<
[
user
,
:developer
]
visit_issues
(
project
)
end
end
context
'when a milestone filter has been applied'
do
context
'when a milestone filter has been applied'
do
it
'resets the milestone filter'
do
it
'resets the milestone filter'
do
filter_by_milestone
(
milestone
.
title
)
visit_issues
(
project
,
milestone_title:
milestone
.
title
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
reset_filters
reset_filters
...
@@ -27,7 +27,7 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -27,7 +27,7 @@ feature 'Issues filter reset button', feature: true, js: true do
context
'when a label filter has been applied'
do
context
'when a label filter has been applied'
do
it
'resets the label filter'
do
it
'resets the label filter'
do
filter_by_label
(
bug
.
titl
e
)
visit_issues
(
project
,
label_name:
bug
.
nam
e
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
reset_filters
reset_filters
...
@@ -37,8 +37,7 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -37,8 +37,7 @@ feature 'Issues filter reset button', feature: true, js: true do
context
'when a text search has been conducted'
do
context
'when a text search has been conducted'
do
it
'resets the text search filter'
do
it
'resets the text search filter'
do
visit_issues
(
project
,
issue_search:
'Bug'
)
fill_in
'issue_search'
,
with:
'Bug'
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
reset_filters
reset_filters
...
@@ -48,7 +47,7 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -48,7 +47,7 @@ feature 'Issues filter reset button', feature: true, js: true do
context
'when author filter has been applied'
do
context
'when author filter has been applied'
do
it
'resets the author filter'
do
it
'resets the author filter'
do
filter_by_author
(
user
.
name
)
visit_issues
(
project
,
author_id:
user
.
id
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
reset_filters
reset_filters
...
@@ -58,7 +57,7 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -58,7 +57,7 @@ feature 'Issues filter reset button', feature: true, js: true do
context
'when assignee filter has been applied'
do
context
'when assignee filter has been applied'
do
it
'resets the assignee filter'
do
it
'resets the assignee filter'
do
filter_by_assignee
(
user
.
name
)
visit_issues
(
project
,
assignee_id:
user
.
id
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
reset_filters
reset_filters
...
@@ -68,17 +67,7 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -68,17 +67,7 @@ feature 'Issues filter reset button', feature: true, js: true do
context
'when all filters have been applied'
do
context
'when all filters have been applied'
do
it
'resets all filters'
do
it
'resets all filters'
do
visit_issues
(
project
,
assignee_id:
user
.
id
,
author_id:
user
.
id
,
milestone_title:
milestone
.
title
,
label_name:
bug
.
name
,
issue_search:
'Bug'
)
wait_for_ajax
filter_by_milestone
(
milestone
.
title
)
wait_for_ajax
filter_by_author
(
user
.
username
)
wait_for_ajax
expect
(
page
).
to
have_css
(
'.issue'
,
count:
0
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
0
)
reset_filters
reset_filters
...
@@ -86,33 +75,7 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -86,33 +75,7 @@ feature 'Issues filter reset button', feature: true, js: true do
end
end
end
end
def
filter_by_milestone
(
title
)
find
(
'.js-milestone-select'
).
click
find
(
'.milestone-filter .dropdown-content a'
,
text:
title
).
click
end
def
filter_by_label
(
title
)
find
(
'.js-label-select'
).
click
find
(
'.labels-filter .dropdown-content a'
,
text:
title
).
click
find
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
end
def
filter_by_author
(
name
)
find
(
'.js-author-search'
).
click
find
(
'.dropdown-menu-author .dropdown-content a'
,
text:
name
).
click
end
def
filter_by_assignee
(
name
)
find
(
'.js-assignee-search'
).
click
find
(
'.dropdown-menu-assignee .dropdown-content a'
,
text:
name
).
click
end
def
reset_filters
def
reset_filters
find
(
'.reset-filters'
).
click
find
(
'.reset-filters'
).
click
wait_for_ajax
end
def
visit_issues
(
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
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