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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
e058ce9f
Commit
e058ce9f
authored
Nov 11, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert and move reset filters spec to MR
parent
1623259c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
96 additions
and
0 deletions
+96
-0
spec/features/merge_requests/reset_filters_spec.rb
spec/features/merge_requests/reset_filters_spec.rb
+96
-0
No files found.
spec/features/
issue
s/reset_filters_spec.rb
→
spec/features/
merge_request
s/reset_filters_spec.rb
View file @
e058ce9f
...
@@ -8,81 +8,88 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -8,81 +8,88 @@ feature 'Issues filter reset button', feature: true, js: true do
let!
(
:user
)
{
create
(
:user
)}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let!
(
:bug
)
{
create
(
:label
,
project:
project
,
name:
'bug'
)}
let!
(
:bug
)
{
create
(
:label
,
project:
project
,
name:
'bug'
)}
let!
(
:issue1
)
{
create
(
:issue
,
project:
project
,
milestone:
milestone
,
author:
user
,
assignee:
user
,
title:
'Feature'
)}
let!
(
:mr1
)
{
create
(
:merge_request
,
title:
"Feature"
,
source_project:
project
,
target_project:
project
,
source_branch:
"Feature"
,
milestone:
milestone
,
author:
user
,
assignee:
user
)
}
let!
(
:issue2
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
bug
],
title:
'Bugfix1'
)}
let!
(
:mr2
)
{
create
(
:merge_request
,
title
:"Bugfix1"
,
source_project:
project
,
target_project:
project
,
source_branch:
"Bugfix1"
)
}
let
(
:merge_request_css
)
{
'.merge-request'
}
before
do
before
do
mr2
.
labels
<<
bug
project
.
team
<<
[
user
,
:developer
]
project
.
team
<<
[
user
,
:developer
]
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
visit_
issue
s
(
project
,
milestone_title:
milestone
.
title
)
visit_
merge_request
s
(
project
,
milestone_title:
milestone
.
title
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
merge_request_css
,
count:
1
)
reset_filters
reset_filters
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_css
(
merge_request_css
,
count:
2
)
end
end
end
end
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
visit_
issue
s
(
project
,
label_name:
bug
.
name
)
visit_
merge_request
s
(
project
,
label_name:
bug
.
name
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
merge_request_css
,
count:
1
)
reset_filters
reset_filters
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_css
(
merge_request_css
,
count:
2
)
end
end
end
end
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_
issue
s
(
project
,
search:
'Bug'
)
visit_
merge_request
s
(
project
,
search:
'Bug'
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
merge_request_css
,
count:
1
)
reset_filters
reset_filters
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_css
(
merge_request_css
,
count:
2
)
end
end
end
end
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
visit_
issue
s
(
project
,
author_id:
user
.
id
)
visit_
merge_request
s
(
project
,
author_id:
user
.
id
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
merge_request_css
,
count:
1
)
reset_filters
reset_filters
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_css
(
merge_request_css
,
count:
2
)
end
end
end
end
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
visit_
issue
s
(
project
,
assignee_id:
user
.
id
)
visit_
merge_request
s
(
project
,
assignee_id:
user
.
id
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
merge_request_css
,
count:
1
)
reset_filters
reset_filters
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_css
(
merge_request_css
,
count:
2
)
end
end
end
end
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_
issue
s
(
project
,
assignee_id:
user
.
id
,
author_id:
user
.
id
,
milestone_title:
milestone
.
title
,
label_name:
bug
.
name
,
search:
'Bug'
)
visit_
merge_request
s
(
project
,
assignee_id:
user
.
id
,
author_id:
user
.
id
,
milestone_title:
milestone
.
title
,
label_name:
bug
.
name
,
search:
'Bug'
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
0
)
expect
(
page
).
to
have_css
(
merge_request_css
,
count:
0
)
reset_filters
reset_filters
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_css
(
merge_request_css
,
count:
2
)
end
end
end
end
context
'when no filters have been applied'
do
context
'when no filters have been applied'
do
it
'the reset link should not be visible'
do
it
'the reset link should not be visible'
do
visit_
issue
s
(
project
)
visit_
merge_request
s
(
project
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_css
(
merge_request_css
,
count:
2
)
expect
(
page
).
not_to
have_css
'.reset_filters'
expect
(
page
).
not_to
have_css
'.reset_filters'
end
end
end
end
def
visit_merge_requests
(
project
,
opts
=
{})
visit
namespace_project_merge_requests_path
project
.
namespace
,
project
,
opts
end
def
reset_filters
def
reset_filters
find
(
'.reset-filters'
).
click
find
(
'.reset-filters'
).
click
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