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
de399c4a
Commit
de399c4a
authored
Dec 16, 2018
by
Jasper Maes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix deprecation: Comparing equality between ActionController::Parameters and a Hash is deprecated
parent
8b460204
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
10 deletions
+16
-10
changelogs/unreleased/deprecated-comparing-actioncontroller-params-hash.yml
...sed/deprecated-comparing-actioncontroller-params-hash.yml
+6
-0
spec/controllers/concerns/issuable_collections_spec.rb
spec/controllers/concerns/issuable_collections_spec.rb
+2
-2
spec/controllers/profiles/preferences_controller_spec.rb
spec/controllers/profiles/preferences_controller_spec.rb
+1
-1
spec/controllers/projects/notes_controller_spec.rb
spec/controllers/projects/notes_controller_spec.rb
+2
-2
spec/controllers/projects/pages_domains_controller_spec.rb
spec/controllers/projects/pages_domains_controller_spec.rb
+1
-1
spec/requests/jwt_controller_spec.rb
spec/requests/jwt_controller_spec.rb
+4
-4
No files found.
changelogs/unreleased/deprecated-comparing-actioncontroller-params-hash.yml
0 → 100644
View file @
de399c4a
---
title
:
'
Fix
deprecation:
Comparing
equality
between
ActionController::Parameters
and
a
Hash
is
deprecated'
merge_request
:
23855
author
:
Jasper Maes
type
:
other
spec/controllers/concerns/issuable_collections_spec.rb
View file @
de399c4a
...
...
@@ -90,7 +90,7 @@ describe IssuableCollections do
finder_options
=
controller
.
send
(
:finder_options
)
expect
(
finder_options
).
to
eq
({
expect
(
finder_options
).
to
eq
(
ActionController
::
Parameters
.
new
(
{
'assignee_id'
=>
'1'
,
'assignee_username'
=>
'user1'
,
'author_id'
=>
'2'
,
...
...
@@ -103,7 +103,7 @@ describe IssuableCollections do
'search'
=>
'baz'
,
'sort'
=>
'priority'
,
'state'
=>
'opened'
})
})
.
permit!
)
end
end
end
spec/controllers/profiles/preferences_controller_spec.rb
View file @
de399c4a
...
...
@@ -45,7 +45,7 @@ describe Profiles::PreferencesController do
theme_id:
'2'
}.
with_indifferent_access
expect
(
user
).
to
receive
(
:assign_attributes
).
with
(
prefs
)
expect
(
user
).
to
receive
(
:assign_attributes
).
with
(
ActionController
::
Parameters
.
new
(
prefs
).
permit!
)
expect
(
user
).
to
receive
(
:save
)
go
params:
prefs
...
...
spec/controllers/projects/notes_controller_spec.rb
View file @
de399c4a
...
...
@@ -248,13 +248,13 @@ describe Projects::NotesController do
context
'when merge_request_diff_head_sha present'
do
before
do
service_params
=
{
service_params
=
ActionController
::
Parameters
.
new
(
{
note:
'some note'
,
noteable_id:
merge_request
.
id
.
to_s
,
noteable_type:
'MergeRequest'
,
merge_request_diff_head_sha:
'sha'
,
in_reply_to_discussion_id:
nil
}
}
).
permit!
expect
(
Notes
::
CreateService
).
to
receive
(
:new
).
with
(
project
,
user
,
service_params
).
and_return
(
double
(
execute:
true
))
end
...
...
spec/controllers/projects/pages_domains_controller_spec.rb
View file @
de399c4a
...
...
@@ -78,7 +78,7 @@ describe Projects::PagesDomainsController do
it
'updates the domain'
do
expect
(
pages_domain
)
.
to
receive
(
:update
)
.
with
(
pages_domain_params
)
.
with
(
ActionController
::
Parameters
.
new
(
pages_domain_params
).
permit!
)
.
and_return
(
true
)
patch
(
:update
,
params
)
...
...
spec/requests/jwt_controller_spec.rb
View file @
de399c4a
...
...
@@ -31,7 +31,7 @@ describe JwtController do
context
'project with enabled CI'
do
subject!
{
get
'/jwt/auth'
,
parameters
,
headers
}
it
{
expect
(
service_class
).
to
have_received
(
:new
).
with
(
project
,
nil
,
parameters
)
}
it
{
expect
(
service_class
).
to
have_received
(
:new
).
with
(
project
,
nil
,
ActionController
::
Parameters
.
new
(
parameters
).
permit!
)
}
end
context
'project with disabled CI'
do
...
...
@@ -57,7 +57,7 @@ describe JwtController do
it
'authenticates correctly'
do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
service_class
).
to
have_received
(
:new
).
with
(
nil
,
user
,
parameters
)
expect
(
service_class
).
to
have_received
(
:new
).
with
(
nil
,
user
,
ActionController
::
Parameters
.
new
(
parameters
).
permit!
)
end
end
end
...
...
@@ -68,7 +68,7 @@ describe JwtController do
subject!
{
get
'/jwt/auth'
,
parameters
,
headers
}
it
{
expect
(
service_class
).
to
have_received
(
:new
).
with
(
nil
,
user
,
parameters
)
}
it
{
expect
(
service_class
).
to
have_received
(
:new
).
with
(
nil
,
user
,
ActionController
::
Parameters
.
new
(
parameters
).
permit!
)
}
context
'when passing a flat array of scopes'
do
# We use this trick to make rails to generate a query_string:
...
...
@@ -83,7 +83,7 @@ describe JwtController do
end
let
(
:service_parameters
)
do
{
service:
service_name
,
scopes:
%w(scope1 scope2)
}
ActionController
::
Parameters
.
new
({
service:
service_name
,
scopes:
%w(scope1 scope2)
}).
permit!
end
it
{
expect
(
service_class
).
to
have_received
(
:new
).
with
(
nil
,
user
,
service_parameters
)
}
...
...
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