aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-07-10 19:53:39 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2010-07-11 02:55:38 -0300
commit16c14f7465530df51e938d00f26141dd0ecf46bc (patch)
tree83b9d0b77549ed15edfe29a853e93971851dcc1a /activemodel/test
parentf33ee69d59d2b06da3c3c1b24fc9bb640bf6ed25 (diff)
downloadrails-16c14f7465530df51e938d00f26141dd0ecf46bc.tar.gz
rails-16c14f7465530df51e938d00f26141dd0ecf46bc.tar.bz2
rails-16c14f7465530df51e938d00f26141dd0ecf46bc.zip
Avoid interpreted as grouped expression warnings
Diffstat (limited to 'activemodel/test')
-rw-r--r--activemodel/test/cases/mass_assignment_security/sanitizer_test.rb2
-rw-r--r--activemodel/test/cases/mass_assignment_security_test.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/activemodel/test/cases/mass_assignment_security/sanitizer_test.rb b/activemodel/test/cases/mass_assignment_security/sanitizer_test.rb
index 367207aab3..015153ec7c 100644
--- a/activemodel/test/cases/mass_assignment_security/sanitizer_test.rb
+++ b/activemodel/test/cases/mass_assignment_security/sanitizer_test.rb
@@ -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
diff --git a/activemodel/test/cases/mass_assignment_security_test.rb b/activemodel/test/cases/mass_assignment_security_test.rb
index 0f7a38b0bc..c25b0fdf00 100644
--- a/activemodel/test/cases/mass_assignment_security_test.rb
+++ b/activemodel/test/cases/mass_assignment_security_test.rb
@@ -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 \ No newline at end of file
+end