Permalink
Browse files

Avoid interpreted as grouped expression warnings

  • Loading branch information...
1 parent f33ee69 commit 16c14f7465530df51e938d00f26141dd0ecf46bc @spastorino spastorino committed Jul 10, 2010
@@ -31,7 +31,7 @@ def setup
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
@@ -35,10 +35,10 @@ def test_mass_assignment_protection_inheritance
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 @@ def test_mass_assignment_multiparameter_protector
assert_equal sanitized, { }
end
-end
+end

0 comments on commit 16c14f7

Please sign in to comment.