BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
fee3c95d
Commit
fee3c95d
authored
Sep 18, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redundant `is_`
parent
3e83ba34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
person.rb
lib/gitlab/ldap/person.rb
+2
-2
person_spec.rb
spec/lib/gitlab/ldap/person_spec.rb
+2
-2
No files found.
lib/gitlab/ldap/person.rb
View file @
fee3c95d
...
...
@@ -38,7 +38,7 @@ module Gitlab
# Returns the UID or DN in a normalized form
def
self
.
normalize_uid_or_dn
(
uid_or_dn
)
if
is_
dn?
(
uid_or_dn
)
if
dn?
(
uid_or_dn
)
normalize_dn
(
uid_or_dn
)
else
normalize_uid
(
uid_or_dn
)
...
...
@@ -49,7 +49,7 @@ module Gitlab
#
# An empty string is technically a valid DN (null DN), although we should
# never need to worry about that.
def
self
.
is_
dn?
(
uid_or_dn
)
def
self
.
dn?
(
uid_or_dn
)
uid_or_dn
.
blank?
||
uid_or_dn
.
include?
(
'='
)
end
...
...
spec/lib/gitlab/ldap/person_spec.rb
View file @
fee3c95d
...
...
@@ -96,7 +96,7 @@ describe Gitlab::LDAP::Person do
it_behaves_like
'normalizes the DN'
end
describe
'.
is_
dn?'
do
describe
'.dn?'
do
where
(
:test_description
,
:given
,
:expected
)
do
'given a DN with a single RDN'
|
'uid=John C. Smith'
|
true
'given a DN with multiple RDNs'
|
'uid=John C. Smith,ou=People,dc=example,dc=com'
|
true
...
...
@@ -110,7 +110,7 @@ describe Gitlab::LDAP::Person do
with_them
do
it
'returns the expected boolean'
do
assert_generic_test
(
test_description
,
described_class
.
is_
dn?
(
given
),
expected
)
assert_generic_test
(
test_description
,
described_class
.
dn?
(
given
),
expected
)
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