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
9412b5ee
Commit
9412b5ee
authored
Sep 03, 2020
by
gaga5lala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIX: handle argument error in api layer
parent
dd778448
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
lib/api/todos.rb
lib/api/todos.rb
+4
-0
spec/requests/api/todos_spec.rb
spec/requests/api/todos_spec.rb
+7
-0
No files found.
lib/api/todos.rb
View file @
9412b5ee
...
...
@@ -11,6 +11,10 @@ module API
'issues'
=>
->
(
iid
)
{
find_project_issue
(
iid
)
}
}.
freeze
rescue_from
ArgumentError
do
|
e
|
render_api_error!
(
e
.
message
,
400
)
end
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
...
...
spec/requests/api/todos_spec.rb
View file @
9412b5ee
...
...
@@ -34,6 +34,13 @@ RSpec.describe API::Todos do
end
context
'when authenticated'
do
context
'when invalid params'
do
it
"returns argument error"
do
get
api
(
'/todos'
,
john_doe
),
params:
{
type:
'InvalidType'
}
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
end
end
it
'returns an array of pending todos for current user'
do
get
api
(
'/todos'
,
john_doe
)
...
...
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