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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0cf7f2f8
Commit
0cf7f2f8
authored
Apr 09, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test update_email method.
parent
cf616a84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
spec/lib/gitlab/ldap/ldap_access_spec.rb
spec/lib/gitlab/ldap/ldap_access_spec.rb
+27
-0
No files found.
spec/lib/gitlab/ldap/ldap_access_spec.rb
View file @
0cf7f2f8
...
@@ -31,4 +31,31 @@ describe Gitlab::LDAP::Access do
...
@@ -31,4 +31,31 @@ describe Gitlab::LDAP::Access do
member
.
group_access
.
should
==
Gitlab
::
Access
::
DEVELOPER
member
.
group_access
.
should
==
Gitlab
::
Access
::
DEVELOPER
end
end
end
end
describe
:update_user_email
do
let
(
:user_ldap
)
{
create
(
:user
,
provider:
'ldap'
,
extern_uid:
"66048"
)}
it
"should not update email if email attribute is not set"
do
entry
=
Net
::
LDAP
::
Entry
.
new
Gitlab
::
LDAP
::
Adapter
.
any_instance
.
stub
(
:user
)
{
Gitlab
::
LDAP
::
Person
.
new
(
entry
)
}
updated
=
access
.
update_email
(
user_ldap
)
updated
.
should
==
false
end
it
"should not update the email if the user has the same email in GitLab and in LDAP"
do
entry
=
Net
::
LDAP
::
Entry
.
new
entry
[
'mail'
]
=
[
user_ldap
.
email
]
Gitlab
::
LDAP
::
Adapter
.
any_instance
.
stub
(
:user
)
{
Gitlab
::
LDAP
::
Person
.
new
(
entry
)
}
updated
=
access
.
update_email
(
user_ldap
)
updated
.
should
==
false
end
it
"should update the email if the user email is different"
do
entry
=
Net
::
LDAP
::
Entry
.
new
entry
[
'mail'
]
=
[
"new_email@example.com"
]
Gitlab
::
LDAP
::
Adapter
.
any_instance
.
stub
(
:user
)
{
Gitlab
::
LDAP
::
Person
.
new
(
entry
)
}
updated
=
access
.
update_email
(
user_ldap
)
updated
.
should
==
true
end
end
end
end
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