BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e1f2ff91
Commit
e1f2ff91
authored
Sep 02, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for reset filters button.
parent
1750fe32
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
0 deletions
+97
-0
reset_filters_spec.rb
spec/features/issues/reset_filters_spec.rb
+97
-0
No files found.
spec/features/issues/reset_filters_spec.rb
0 → 100644
View file @
e1f2ff91
require
'rails_helper'
feature
'Filter Resetter'
,
feature:
true
do
include
WaitForAjax
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
context
'resets the milestone filter'
,
js:
true
do
it
'shows all issues when reset'
do
create
(
:issue
,
project:
project
,
milestone:
milestone
)
create
(
:issue
,
project:
project
)
visit_issues
(
project
)
filter_by_milestone
(
milestone
.
title
)
expect
(
page
).
to
have_css
(
".issue"
,
count:
1
)
reset_filters
expect
(
page
).
to
have_css
(
".issue"
,
count:
2
)
end
end
context
'resets labels filter'
,
js
:true
do
it
'shows all issues when reset'
do
bug
=
create
(
:label
,
project:
project
,
title:
'bug'
)
issue1
=
create
(
:issue
,
title:
"Bugfix1"
,
project:
project
)
issue1
.
labels
<<
bug
issue2
=
create
(
:issue
,
title:
"Feature"
,
project:
project
)
visit_issues
(
project
)
filter_by_label
(
bug
.
title
)
expect
(
page
).
to
have_css
(
".issue"
,
count:
1
)
reset_filters
expect
(
page
).
to
have_css
(
".issue"
,
count:
2
)
end
end
context
'resets text filter'
,
js
:true
do
it
'shows all issues when reset'
do
issue1
=
create
(
:issue
,
title:
"Bugfix1"
,
project:
project
)
issue2
=
create
(
:issue
,
title:
"Feature"
,
project:
project
)
visit_issues
(
project
)
fill_in
'issue_search'
,
with:
'Bug'
expect
(
page
).
to
have_css
(
".issue"
,
count:
1
)
reset_filters
expect
(
page
).
to
have_css
(
".issue"
,
count:
2
)
end
end
context
'resets label and text dually applied'
,
js
:true
do
it
'shows all issues when reset'
do
bug
=
create
(
:label
,
project:
project
,
title:
'bug'
)
issue1
=
create
(
:issue
,
title:
"Bugfix1"
,
project:
project
)
issue1
.
labels
<<
bug
issue2
=
create
(
:issue
,
project:
project
,
title:
'Feature1'
)
visit_issues
(
project
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
fill_in
'issue_search'
,
with:
'Feat'
expect
(
page
).
to
have_css
(
".issue"
,
count:
1
)
wait_for_ajax
filter_by_label
(
bug
.
title
)
expect
(
page
).
to
have_css
(
".issue"
,
count:
0
)
reset_filters
expect
(
page
).
to
have_css
(
".issue"
,
count:
2
)
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
reset_filters
()
find
(
".reset-filters"
).
click
wait_for_ajax
end
def
visit_issues
(
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
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