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
539963dc
Commit
539963dc
authored
Oct 30, 2018
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
73ecc2d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
ee/app/finders/ee/issues_finder.rb
ee/app/finders/ee/issues_finder.rb
+2
-2
ee/spec/requests/api/issues_spec.rb
ee/spec/requests/api/issues_spec.rb
+2
-1
lib/api/issues.rb
lib/api/issues.rb
+11
-2
No files found.
ee/app/finders/ee/issues_finder.rb
View file @
539963dc
...
...
@@ -39,11 +39,11 @@ module EE
end
def
filter_by_no_weight?
params
[
:weight
].
to_s
.
downcase
==
FILTER_NONE
params
[
:weight
].
to_s
.
downcase
==
::
IssuesFinder
::
FILTER_NONE
end
def
filter_by_any_weight?
params
[
:weight
].
to_s
.
downcase
==
FILTER_ANY
params
[
:weight
].
to_s
.
downcase
==
::
IssuesFinder
::
FILTER_ANY
end
override
:by_assignee
...
...
ee/spec/requests/api/issues_spec.rb
View file @
539963dc
...
...
@@ -39,11 +39,12 @@ describe API::Issues, :mailer do
describe
"filtering by weight"
do
before
do
issue2
=
create
(
:issue
,
author:
user2
,
project:
project
,
weight:
5
)
create
(
:issue
,
author:
user2
,
project:
project
,
weight:
1
)
create
(
:issue
,
author:
user2
,
project:
project
,
weight:
3
)
end
let!
(
:issue2
)
{
create
(
:issue
,
author:
user2
,
project:
project
,
weight:
5
)
}
it
'returns issues with specific weight'
do
get
api
(
'/issues'
,
user
),
weight:
5
,
scope:
'all'
...
...
lib/api/issues.rb
View file @
539963dc
...
...
@@ -25,7 +25,7 @@ module API
end
# rubocop: enable CodeReuse/ActiveRecord
params
:issues_params
do
params
:issues_params
_ce
do
optional
:labels
,
type:
String
,
desc:
'Comma-separated list of label names'
optional
:milestone
,
type:
String
,
desc:
'Milestone title'
optional
:order_by
,
type:
String
,
values:
%w[created_at updated_at]
,
default:
'created_at'
,
...
...
@@ -48,6 +48,15 @@ module API
use
:pagination
end
params
:issues_params_ee
do
optional
:weight
,
types:
[
Integer
,
String
],
integer_none_any:
true
,
desc:
'The weight of the issue'
end
params
:issues_params
do
use
:issues_params_ce
use
:issues_params_ee
end
params
:issue_params_ce
do
optional
:description
,
type:
String
,
desc:
'The description of an issue'
optional
:assignee_ids
,
type:
Array
[
Integer
],
desc:
'The array of user IDs to assign issue'
...
...
@@ -60,7 +69,7 @@ module API
end
params
:issue_params_ee
do
optional
:weight
,
type:
[
Integer
,
String
],
integer_none_any:
true
,
desc:
'The weight of the issue'
optional
:weight
,
type:
Integer
,
desc:
'The weight of the issue'
end
params
:issue_params
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