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
Kazuhiko Shiozaki
gitlab-ce
Commits
e1344a08
Commit
e1344a08
authored
Jul 28, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1163 from tomykaira/bug_1009
Fix #1009 Replace all special characters in user's identity
parents
354d2438
03a2995e
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 @
e1344a08
module
Account
module
Account
def
identifier
def
identifier
email
.
gsub
/[
@.
]/
,
"_"
email
.
gsub
/[
^[:alnum:]
]/
,
"_"
end
end
def
is_admin?
def
is_admin?
...
...
spec/models/user_spec.rb
View file @
e1344a08
...
@@ -22,6 +22,11 @@ describe User do
...
@@ -22,6 +22,11 @@ describe User do
user
.
identifier
.
should
==
"test_mail_com"
user
.
identifier
.
should
==
"test_mail_com"
end
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
it
"should execute callback when force_random_password specified"
do
user
=
User
.
new
(
:email
=>
"test@mail.com"
,
:force_random_password
=>
true
)
user
=
User
.
new
(
:email
=>
"test@mail.com"
,
:force_random_password
=>
true
)
user
.
should_receive
(
:generate_password
)
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