Rename method to `to_normalized_s`

This commit is contained in:
Michael Kozono 2017-10-02 15:00:50 -07:00
parent a6a764f73d
commit 714f264d62
5 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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:
#