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
Tatuya Kamada
gitlab-ce
Commits
03a2995e
Commit
03a2995e
authored
Jul 28, 2012
by
tomykaira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #1009 Replace all special characters in user's identity
parent
8b7e404b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
app/roles/account.rb
app/roles/account.rb
+1
-1
spec/models/user_spec.rb
spec/models/user_spec.rb
+5
-0
No files found.
app/roles/account.rb
View file @
03a2995e
module
Account
def
identifier
email
.
gsub
/[
@.
]/
,
"_"
email
.
gsub
/[
^[:alnum:]
]/
,
"_"
end
def
is_admin?
...
...
spec/models/user_spec.rb
View file @
03a2995e
...
...
@@ -22,6 +22,11 @@ describe User do
user
.
identifier
.
should
==
"test_mail_com"
end
it
"should return identifier without + sign"
do
user
=
User
.
new
(
:email
=>
"test+foo@mail.com"
)
user
.
identifier
.
should
==
"test_foo_mail_com"
end
it
"should execute callback when force_random_password specified"
do
user
=
User
.
new
(
:email
=>
"test@mail.com"
,
:force_random_password
=>
true
)
user
.
should_receive
(
:generate_password
)
...
...
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