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
1b109c99
Commit
1b109c99
authored
Dec 23, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a Grape deprecation, use `#request_method` instead of `#route_method`
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
5866f7b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
changelogs/unreleased/fix-api-deprecation.yml
changelogs/unreleased/fix-api-deprecation.yml
+4
-0
lib/api/helpers.rb
lib/api/helpers.rb
+1
-1
spec/requests/api/helpers_spec.rb
spec/requests/api/helpers_spec.rb
+2
-2
No files found.
changelogs/unreleased/fix-api-deprecation.yml
0 → 100644
View file @
1b109c99
---
title
:
Fix a Grape deprecation, use `#request_method` instead of `#route_method`
merge_request
:
author
:
lib/api/helpers.rb
View file @
1b109c99
...
...
@@ -96,7 +96,7 @@ module API
end
def
authenticate_non_get!
authenticate!
unless
%w[GET HEAD]
.
include?
(
route
.
r
oute
_method
)
authenticate!
unless
%w[GET HEAD]
.
include?
(
route
.
r
equest
_method
)
end
def
authenticate_by_gitlab_shell_token!
...
...
spec/requests/api/helpers_spec.rb
View file @
1b109c99
...
...
@@ -396,7 +396,7 @@ describe API::Helpers, api: true do
%w[HEAD GET]
.
each
do
|
method_name
|
context
"method is
#{
method_name
}
"
do
before
do
expect_any_instance_of
(
self
.
class
).
to
receive
(
:route
).
and_return
(
double
(
r
oute
_method:
method_name
))
expect_any_instance_of
(
self
.
class
).
to
receive
(
:route
).
and_return
(
double
(
r
equest
_method:
method_name
))
end
it
'does not raise an error'
do
...
...
@@ -410,7 +410,7 @@ describe API::Helpers, api: true do
%w[POST PUT PATCH DELETE]
.
each
do
|
method_name
|
context
"method is
#{
method_name
}
"
do
before
do
expect_any_instance_of
(
self
.
class
).
to
receive
(
:route
).
and_return
(
double
(
r
oute
_method:
method_name
))
expect_any_instance_of
(
self
.
class
).
to
receive
(
:route
).
and_return
(
double
(
r
equest
_method:
method_name
))
end
it
'calls authenticate!'
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