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
7f440b92
Commit
7f440b92
authored
Sep 05, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean reset filters test.
parent
e1f2ff91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
26 deletions
+27
-26
spec/features/issues/reset_filters_spec.rb
spec/features/issues/reset_filters_spec.rb
+27
-26
No files found.
spec/features/issues/reset_filters_spec.rb
View file @
7f440b92
...
@@ -14,80 +14,81 @@ feature 'Filter Resetter', feature: true do
...
@@ -14,80 +14,81 @@ feature 'Filter Resetter', feature: true do
visit_issues
(
project
)
visit_issues
(
project
)
filter_by_milestone
(
milestone
.
title
)
filter_by_milestone
(
milestone
.
title
)
expect
(
page
).
to
have_css
(
".issue"
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
reset_filters
reset_filters
expect
(
page
).
to
have_css
(
".issue"
,
count:
2
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
end
end
end
end
context
'resets labels filter'
,
js
:true
do
context
'resets labels filter'
,
js:
true
do
it
'shows all issues when reset'
do
it
'shows all issues when reset'
do
bug
=
create
(
:label
,
project:
project
,
title:
'bug'
)
bug
=
create
(
:label
,
project:
project
,
title:
'bug'
)
issue1
=
create
(
:issue
,
title:
"Bugfix1"
,
project:
project
)
issue1
=
create
(
:issue
,
title:
'Bugfix1'
,
project:
project
)
issue1
.
labels
<<
bug
issue1
.
labels
<<
bug
issue2
=
create
(
:issue
,
title:
"Feature"
,
project:
project
)
create
(
:issue
,
title:
'Feature'
,
project:
project
)
visit_issues
(
project
)
visit_issues
(
project
)
filter_by_label
(
bug
.
title
)
filter_by_label
(
bug
.
title
)
expect
(
page
).
to
have_css
(
".issue"
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
reset_filters
reset_filters
expect
(
page
).
to
have_css
(
".issue"
,
count:
2
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
end
end
end
end
context
'resets text filter'
,
js
:true
do
context
'resets text filter'
,
js:
true
do
it
'shows all issues when reset'
do
it
'shows all issues when reset'
do
issue1
=
create
(
:issue
,
title:
"Bugfix1"
,
project:
project
)
create
(
:issue
,
title:
'Bugfix1'
,
project:
project
)
issue2
=
create
(
:issue
,
title:
"Feature"
,
project:
project
)
create
(
:issue
,
title:
'Feature'
,
project:
project
)
visit_issues
(
project
)
visit_issues
(
project
)
fill_in
'issue_search'
,
with:
'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
expect
(
page
).
to
have_css
(
".issue"
,
count:
2
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
end
end
end
end
context
'resets label and text dually applied'
,
js
:true
do
context
'resets label and text dually applied'
,
js:
true
do
it
'shows all issues when reset'
do
it
'shows all issues when reset'
do
bug
=
create
(
:label
,
project:
project
,
title:
'bug'
)
bug
=
create
(
:label
,
project:
project
,
title:
'bug'
)
issue1
=
create
(
:issue
,
title:
"Bugfix1"
,
project:
project
)
issue1
=
create
(
:issue
,
title:
'Bugfix1'
,
project:
project
)
issue1
.
labels
<<
bug
issue1
.
labels
<<
bug
issue2
=
create
(
:issue
,
project:
project
,
title:
'Feature1'
)
create
(
:issue
,
project:
project
,
title:
'Feature1'
)
visit_issues
(
project
)
visit_issues
(
project
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
fill_in
'issue_search'
,
with:
'Feat'
fill_in
'issue_search'
,
with:
'Feat'
expect
(
page
).
to
have_css
(
".issue"
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
wait_for_ajax
wait_for_ajax
filter_by_label
(
bug
.
title
)
filter_by_label
(
bug
.
title
)
expect
(
page
).
to
have_css
(
".issue"
,
count:
0
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
0
)
reset_filters
reset_filters
expect
(
page
).
to
have_css
(
".issue"
,
count:
2
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
end
end
end
end
def
filter_by_milestone
(
title
)
def
filter_by_milestone
(
title
)
find
(
".js-milestone-select"
).
click
find
(
'.js-milestone-select'
).
click
find
(
".milestone-filter .dropdown-content a"
,
text:
title
).
click
find
(
'.milestone-filter .dropdown-content a'
,
text:
title
).
click
end
end
def
filter_by_label
(
title
)
def
filter_by_label
(
title
)
find
(
".js-label-select"
).
click
find
(
'.js-label-select'
).
click
find
(
".labels-filter .dropdown-content a"
,
text:
title
).
click
find
(
'.labels-filter .dropdown-content a'
,
text:
title
).
click
find
(
".labels-filter .dropdown-title .dropdown-menu-close-icon"
).
click
find
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
end
end
def
reset_filters
()
def
reset_filters
find
(
".reset-filters"
).
click
find
(
'.reset-filters'
).
click
wait_for_ajax
wait_for_ajax
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