Permalink
Browse files

Merge pull request #10 from asanghi/master

Fix Deprecations on use of assert_blank?
  • Loading branch information...
2 parents 369818e + f576a7d commit 516faf02d1fc3aba244601aa8921381053d36b2b @carlosantoniodasilva carlosantoniodasilva committed Jan 16, 2013
Showing with 8 additions and 8 deletions.
  1. +8 −8 test/mass_assignment_security_test.rb
@@ -71,29 +71,29 @@ def test_attributes_protected_by_default
end
def test_mass_assignment_protection_inheritance
- assert_blank SpecialLoosePerson.accessible_attributes
+ assert SpecialLoosePerson.accessible_attributes.blank?
assert_equal Set.new(['credit_rating', 'administrator']), SpecialLoosePerson.protected_attributes
- assert_blank SpecialLoosePerson.accessible_attributes
+ assert SpecialLoosePerson.accessible_attributes.blank?
assert_equal Set.new(['credit_rating']), SpecialLoosePerson.protected_attributes(:admin)
- assert_blank LooseDescendant.accessible_attributes
+ assert LooseDescendant.accessible_attributes.blank?
assert_equal Set.new(['credit_rating', 'administrator', 'phone_number']), LooseDescendant.protected_attributes
- assert_blank LooseDescendantSecond.accessible_attributes
+ assert LooseDescendantSecond.accessible_attributes.blank?
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_blank SpecialTightPerson.protected_attributes - SpecialTightPerson.attributes_protected_by_default
+ assert((SpecialTightPerson.protected_attributes - SpecialTightPerson.attributes_protected_by_default).blank?)
assert_equal Set.new(['name', 'address']), SpecialTightPerson.accessible_attributes
- assert_blank SpecialTightPerson.protected_attributes(:admin) - SpecialTightPerson.attributes_protected_by_default
+ assert((SpecialTightPerson.protected_attributes(:admin) - SpecialTightPerson.attributes_protected_by_default).blank?)
assert_equal Set.new(['name', 'address', 'admin']), SpecialTightPerson.accessible_attributes(:admin)
- assert_blank TightDescendant.protected_attributes - TightDescendant.attributes_protected_by_default
+ assert((TightDescendant.protected_attributes - TightDescendant.attributes_protected_by_default).blank?)
assert_equal Set.new(['name', 'address', 'phone_number']), TightDescendant.accessible_attributes
- assert_blank TightDescendant.protected_attributes(:admin) - TightDescendant.attributes_protected_by_default
+ assert((TightDescendant.protected_attributes(:admin) - TightDescendant.attributes_protected_by_default).blank?)
assert_equal Set.new(['name', 'address', 'admin', 'super_powers']), TightDescendant.accessible_attributes(:admin)
end

0 comments on commit 516faf0

Please sign in to comment.