Commit 714f264d authored by Michael Kozono's avatar Michael Kozono

Rename method to `to_normalized_s`

parent a6a764f7
......@@ -220,7 +220,7 @@ class NormalizeLdapExternUids < ActiveRecord::Migration
##
# Return the DN as an escaped and normalized string.
def to_s_normalized
def to_normalized_s
self.class.new(*to_a).to_s
end
......@@ -270,7 +270,7 @@ class NormalizeLdapExternUids < ActiveRecord::Migration
ldap_identities = Identity.where("provider like 'ldap%'")
ldap_identities.find_each do |identity|
begin
identity.extern_uid = Gitlab::LDAP::DN.new(identity.extern_uid).to_s_normalized
identity.extern_uid = Gitlab::LDAP::DN.new(identity.extern_uid).to_normalized_s
unless identity.save
say "Unable to normalize \"#{identity.extern_uid}\". Skipping."
end
......
......@@ -4,7 +4,7 @@ module Gitlab
module LDAP
class AuthHash < Gitlab::OAuth::AuthHash
def uid
Gitlab::LDAP::DN.new(super).to_s_normalized
Gitlab::LDAP::DN.new(super).to_normalized_s
end
private
......
......@@ -235,7 +235,7 @@ module Gitlab
##
# Return the DN as an escaped and normalized string.
def to_s_normalized
def to_normalized_s
self.class.new(*to_a).to_s.downcase
end
......
......@@ -72,7 +72,7 @@ module Gitlab
end
def dn
DN.new(entry.dn).to_s_normalized
DN.new(entry.dn).to_normalized_s
end
private
......
......@@ -3,8 +3,8 @@ require 'spec_helper'
describe Gitlab::LDAP::DN do
using RSpec::Parameterized::TableSyntax
describe '#to_s_normalized' do
subject { described_class.new(given).to_s_normalized }
describe '#to_normalized_s' do
subject { described_class.new(given).to_normalized_s }
# Regarding the telephoneNumber test:
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment