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
Léo-Paul Géneau
gitlab-ce
Commits
f38aa2bf
Commit
f38aa2bf
authored
Sep 26, 2018
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add missing allowed attributes
parent
921c96ab
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
app/services/users/build_service.rb
app/services/users/build_service.rb
+3
-1
spec/services/users/build_service_spec.rb
spec/services/users/build_service_spec.rb
+42
-0
No files found.
app/services/users/build_service.rb
View file @
f38aa2bf
...
...
@@ -68,7 +68,9 @@ module Users
:twitter
,
:username
,
:website_url
,
:private_profile
:private_profile
,
:organization
,
:location
]
end
...
...
spec/services/users/build_service_spec.rb
View file @
f38aa2bf
...
...
@@ -14,6 +14,48 @@ describe Users::BuildService do
expect
(
service
.
execute
).
to
be_valid
end
context
'allowed params'
do
let
(
:params
)
do
{
access_level:
1
,
admin:
1
,
avatar:
anything
,
bio:
1
,
can_create_group:
1
,
color_scheme_id:
1
,
email:
1
,
external:
1
,
force_random_password:
1
,
hide_no_password:
1
,
hide_no_ssh_key:
1
,
linkedin:
1
,
name:
1
,
password:
1
,
password_automatically_set:
1
,
password_expires_at:
1
,
projects_limit:
1
,
remember_me:
1
,
skip_confirmation:
1
,
skype:
1
,
theme_id:
1
,
twitter:
1
,
username:
1
,
website_url:
1
,
private_profile:
1
,
organization:
1
,
location:
1
}
end
it
'sets all allowed attributes'
do
admin_user
# call first so the admin gets created before setting `expect`
expect
(
User
).
to
receive
(
:new
).
with
(
hash_including
(
params
)).
and_call_original
service
.
execute
end
end
context
'with "user_default_external" application setting'
do
using
RSpec
::
Parameterized
::
TableSyntax
...
...
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