1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Avoid interpreted as grouped expression warnings

This commit is contained in:
Santiago Pastorino 2010-07-10 19:53:39 -03:00
parent f33ee69d59
commit 16c14f7465
2 changed files with 4 additions and 4 deletions

View file

@ -31,7 +31,7 @@ class SanitizerTest < ActiveModel::TestCase
log = StringIO.new
@sanitizer.logger = Logger.new(log)
@sanitizer.sanitize(original_attributes)
assert (log.string =~ /admin/), "Should log removed attributes: #{log.string}"
assert_match(/admin/, log.string, "Should log removed attributes: #{log.string}")
end
end

View file

@ -35,10 +35,10 @@ class MassAssignmentSecurityTest < ActiveModel::TestCase
assert_equal Set.new([ 'credit_rating', 'administrator', 'phone_number', 'name']), LooseDescendantSecond.protected_attributes,
'Running attr_protected twice in one class should merge the protections'
assert (TightPerson.protected_attributes - TightPerson.attributes_protected_by_default).blank?
assert_blank TightPerson.protected_attributes - TightPerson.attributes_protected_by_default
assert_equal Set.new([ 'name', 'address' ]), TightPerson.accessible_attributes
assert (TightDescendant.protected_attributes - TightDescendant.attributes_protected_by_default).blank?
assert_blank TightDescendant.protected_attributes - TightDescendant.attributes_protected_by_default
assert_equal Set.new([ 'name', 'address', 'phone_number' ]), TightDescendant.accessible_attributes
end
@ -49,4 +49,4 @@ class MassAssignmentSecurityTest < ActiveModel::TestCase
assert_equal sanitized, { }
end
end
end