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
4e7aebd3
Commit
4e7aebd3
authored
Apr 04, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
e36027d7
7dcc3003
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
4 deletions
+64
-4
app/controllers/dashboard_controller.rb
app/controllers/dashboard_controller.rb
+4
-1
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+0
-1
spec/controllers/concerns/issuable_collections_spec.rb
spec/controllers/concerns/issuable_collections_spec.rb
+2
-2
spec/controllers/dashboard_controller_spec.rb
spec/controllers/dashboard_controller_spec.rb
+33
-0
spec/features/dashboard/merge_requests_spec.rb
spec/features/dashboard/merge_requests_spec.rb
+25
-0
No files found.
app/controllers/dashboard_controller.rb
View file @
4e7aebd3
...
...
@@ -46,7 +46,10 @@ class DashboardController < Dashboard::ApplicationController
end
def
check_filters_presence!
@no_filters_set
=
finder_type
.
scalar_params
.
none?
{
|
k
|
params
.
key?
(
k
)
}
no_scalar_filters_set
=
finder_type
.
scalar_params
.
none?
{
|
k
|
params
.
key?
(
k
)
}
no_array_filters_set
=
finder_type
.
array_params
.
none?
{
|
k
,
_
|
params
.
key?
(
k
)
}
@no_filters_set
=
no_scalar_filters_set
&&
no_array_filters_set
return
unless
@no_filters_set
...
...
app/finders/issuable_finder.rb
View file @
4e7aebd3
...
...
@@ -53,7 +53,6 @@ class IssuableFinder
assignee_username
author_id
author_username
label_name
milestone_title
my_reaction_emoji
search
...
...
spec/controllers/concerns/issuable_collections_spec.rb
View file @
4e7aebd3
...
...
@@ -117,7 +117,7 @@ describe IssuableCollections do
due_date:
'2017-01-01'
,
group_id:
'3'
,
iids:
'4'
,
label_name:
'foo'
,
label_name:
[
'foo'
]
,
milestone_title:
'bar'
,
my_reaction_emoji:
'thumbsup'
,
non_archived:
'true'
,
...
...
@@ -142,7 +142,7 @@ describe IssuableCollections do
'author_id'
=>
'2'
,
'author_username'
=>
'user2'
,
'confidential'
=>
true
,
'label_name'
=>
'foo'
,
'label_name'
=>
[
'foo'
]
,
'milestone_title'
=>
'bar'
,
'my_reaction_emoji'
=>
'thumbsup'
,
'due_date'
=>
'2017-01-01'
,
...
...
spec/controllers/dashboard_controller_spec.rb
View file @
4e7aebd3
...
...
@@ -23,4 +23,37 @@ describe DashboardController do
it_behaves_like
'authenticates sessionless user'
,
:issues
,
:atom
,
author_id:
User
.
first
it_behaves_like
'authenticates sessionless user'
,
:issues_calendar
,
:ics
describe
"#check_filters_presence!"
do
let
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
get
:merge_requests
,
params:
params
end
context
"no filters"
do
let
(
:params
)
{
{}
}
it
'sets @no_filters_set to false'
do
expect
(
assigns
[
:no_filters_set
]).
to
eq
(
true
)
end
end
context
"scalar filters"
do
let
(
:params
)
{
{
author_id:
user
.
id
}
}
it
'sets @no_filters_set to false'
do
expect
(
assigns
[
:no_filters_set
]).
to
eq
(
false
)
end
end
context
"array filters"
do
let
(
:params
)
{
{
label_name:
[
'bug'
]
}
}
it
'sets @no_filters_set to false'
do
expect
(
assigns
[
:no_filters_set
]).
to
eq
(
false
)
end
end
end
end
spec/features/dashboard/merge_requests_spec.rb
View file @
4e7aebd3
...
...
@@ -46,6 +46,8 @@ describe 'Dashboard Merge Requests' do
end
context
'merge requests exist'
do
let
(
:label
)
{
create
(
:label
)
}
let!
(
:assigned_merge_request
)
do
create
(
:merge_request
,
assignee:
current_user
,
...
...
@@ -74,6 +76,14 @@ describe 'Dashboard Merge Requests' do
target_project:
public_project
,
source_project:
forked_project
)
end
let!
(
:labeled_merge_request
)
do
create
(
:labeled_merge_request
,
source_branch:
'labeled'
,
labels:
[
label
],
author:
current_user
,
source_project:
project
)
end
let!
(
:other_merge_request
)
do
create
(
:merge_request
,
source_branch:
'fix'
,
...
...
@@ -92,6 +102,7 @@ describe 'Dashboard Merge Requests' do
expect
(
page
).
not_to
have_content
(
authored_merge_request
.
title
)
expect
(
page
).
not_to
have_content
(
authored_merge_request_from_fork
.
title
)
expect
(
page
).
not_to
have_content
(
other_merge_request
.
title
)
expect
(
page
).
not_to
have_content
(
labeled_merge_request
.
title
)
end
it
'shows authored merge requests'
,
:js
do
...
...
@@ -100,7 +111,21 @@ describe 'Dashboard Merge Requests' do
expect
(
page
).
to
have_content
(
authored_merge_request
.
title
)
expect
(
page
).
to
have_content
(
authored_merge_request_from_fork
.
title
)
expect
(
page
).
to
have_content
(
labeled_merge_request
.
title
)
expect
(
page
).
not_to
have_content
(
assigned_merge_request
.
title
)
expect
(
page
).
not_to
have_content
(
assigned_merge_request_from_fork
.
title
)
expect
(
page
).
not_to
have_content
(
other_merge_request
.
title
)
end
it
'shows labeled merge requests'
,
:js
do
reset_filters
input_filtered_search
(
"label:
#{
label
.
name
}
"
)
expect
(
page
).
to
have_content
(
labeled_merge_request
.
title
)
expect
(
page
).
not_to
have_content
(
authored_merge_request
.
title
)
expect
(
page
).
not_to
have_content
(
authored_merge_request_from_fork
.
title
)
expect
(
page
).
not_to
have_content
(
assigned_merge_request
.
title
)
expect
(
page
).
not_to
have_content
(
assigned_merge_request_from_fork
.
title
)
expect
(
page
).
not_to
have_content
(
other_merge_request
.
title
)
...
...
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