Fixed unit tests.

This commit is contained in:
Martin Edenhofer 2016-01-15 20:40:29 +01:00
parent 815666a994
commit 40f6314177
2 changed files with 7 additions and 7 deletions

View file

@ -442,7 +442,7 @@ returns
# do lookup with == to handle case insensitive databases
records = where(login: data[:login])
records.each {|loop_record|
if loop_record.login.casecmp data[:login] == 0
if loop_record.login.casecmp(data[:login]) == 0
loop_record.update_attributes(data)
return loop_record
end
@ -455,7 +455,7 @@ returns
# do lookup with == to handle case insensitive databases
records = where(email: data[:email])
records.each {|loop_record|
if loop_record.email.casecmp data[:email] == 0
if loop_record.email.casecmp(data[:email]) == 0
loop_record.update_attributes(data)
return loop_record
end
@ -468,7 +468,7 @@ returns
# do lookup with == to handle case insensitive databases
records = where(locale: data[:locale])
records.each {|loop_record|
if loop_record.locale.casecmp data[:locale] == 0
if loop_record.locale.casecmp(data[:locale]) == 0
loop_record.update_attributes(data)
return loop_record
end

View file

@ -31,7 +31,7 @@ class String
=end
def to_filename
camel_cased_word = to_s
camel_cased_word = "#{self}" # rubocop:disable Style/UnneededInterpolation
camel_cased_word.gsub(/::/, '/')
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
@ -48,7 +48,7 @@ class String
=end
def to_classname
camel_cased_word = to_s
camel_cased_word = "#{self}" # rubocop:disable Style/UnneededInterpolation
camel_cased_word.gsub!(/\.rb$/, '')
camel_cased_word.split('/').map(&:camelize).join('::')
end
@ -79,7 +79,7 @@ class String
=end
def html2text(string_only = false)
string = to_s
string = "#{self}" # rubocop:disable Style/UnneededInterpolation
# in case of invalid encodeing, strip invalid chars
# see also test/fixtures/mail21.box