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
Boxiang Sun
gitlab-ce
Commits
66c9a311
Commit
66c9a311
authored
Feb 08, 2019
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for filtering confidential issues
parent
bd9ae901
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
spec/features/issues/filtered_search/dropdown_hint_spec.rb
spec/features/issues/filtered_search/dropdown_hint_spec.rb
+9
-0
spec/finders/issues_finder_spec.rb
spec/finders/issues_finder_spec.rb
+27
-1
No files found.
spec/features/issues/filtered_search/dropdown_hint_spec.rb
View file @
66c9a311
...
...
@@ -119,6 +119,15 @@ describe 'Dropdown hint', :js do
expect_tokens
([{
name:
'my-reaction'
}])
expect_filtered_search_input_empty
end
it
'opens the yes-no dropdown when you click on confidential'
do
click_hint
(
'confidential'
)
expect
(
page
).
to
have_css
(
js_dropdown_hint
,
visible:
false
)
expect
(
page
).
to
have_css
(
'#js-dropdown-confidential'
,
visible:
true
)
expect_tokens
([{
name:
'confidential'
}])
expect_filtered_search_input_empty
end
end
describe
'selecting from dropdown with some input'
do
...
...
spec/finders/issues_finder_spec.rb
View file @
66c9a311
...
...
@@ -460,6 +460,32 @@ describe IssuesFinder do
end
end
context
'filtering by confidential'
do
set
(
:confidential_issue
)
{
create
(
:issue
,
project:
project1
,
confidential:
true
)
}
context
'no filtering'
do
it
'returns all issues'
do
expect
(
issues
).
to
contain_exactly
(
issue1
,
issue2
,
issue3
,
issue4
,
confidential_issue
)
end
end
context
'user filters confidential issues'
do
let
(
:params
)
{
{
confidential:
'yes'
}
}
it
'returns only confdential issues'
do
expect
(
issues
).
to
contain_exactly
(
confidential_issue
)
end
end
context
'user filters only public issues'
do
let
(
:params
)
{
{
confidential:
'no'
}
}
it
'returns only confdential issues'
do
expect
(
issues
).
to
contain_exactly
(
issue1
,
issue2
,
issue3
,
issue4
)
end
end
end
context
'when the user is unauthorized'
do
let
(
:search_user
)
{
nil
}
...
...
@@ -526,7 +552,7 @@ describe IssuesFinder do
it
'returns the number of rows for the default state'
do
finder
=
described_class
.
new
(
user
)
expect
(
finder
.
row_count
).
to
eq
(
4
)
expect
(
finder
.
row_count
).
to
eq
(
5
)
end
it
'returns the number of rows for a given state'
do
...
...
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