diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-31 12:24:30 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-31 12:24:30 +0200 |
commit | 139a9f7011687d5bb9df940957cd726c75e361cc (patch) | |
tree | 0c88cb4f6cc6abd9c2477d9eadc3c398dbb6b042 /activemodel/test/cases/mass_assignment_security | |
parent | 16384351526bc5c4d064d6f4c720b8641acf125c (diff) | |
download | rails-139a9f7011687d5bb9df940957cd726c75e361cc.tar.gz rails-139a9f7011687d5bb9df940957cd726c75e361cc.tar.bz2 rails-139a9f7011687d5bb9df940957cd726c75e361cc.zip |
Transform the symbol into a constant lookup.
Diffstat (limited to 'activemodel/test/cases/mass_assignment_security')
-rw-r--r-- | activemodel/test/cases/mass_assignment_security/sanitizer_test.rb | 8 |
1 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 e9e7eee0bd..62a6ec9c9b 100644 --- a/activemodel/test/cases/mass_assignment_security/sanitizer_test.rb +++ b/activemodel/test/cases/mass_assignment_security/sanitizer_test.rb @@ -3,7 +3,7 @@ require 'logger' require 'active_support/core_ext/object/inclusion' class SanitizerTest < ActiveModel::TestCase - + attr_accessor :logger class Authorizer < ActiveModel::MassAssignmentSecurity::PermissionSet def deny?(key) @@ -12,8 +12,8 @@ class SanitizerTest < ActiveModel::TestCase end def setup - @logger_sanitizer = ActiveModel::MassAssignmentSecurity::LoggerSanitizer.new - @strict_sanitizer = ActiveModel::MassAssignmentSecurity::StrictSanitizer.new + @logger_sanitizer = ActiveModel::MassAssignmentSecurity::LoggerSanitizer.new(self) + @strict_sanitizer = ActiveModel::MassAssignmentSecurity::StrictSanitizer.new(self) @authorizer = Authorizer.new end @@ -28,7 +28,7 @@ class SanitizerTest < ActiveModel::TestCase test "debug mass assignment removal with LoggerSanitizer" do original_attributes = { 'first_name' => 'allowed', 'admin' => 'denied' } log = StringIO.new - @logger_sanitizer.logger = Logger.new(log) + self.logger = Logger.new(log) @logger_sanitizer.sanitize(original_attributes, @authorizer) assert_match(/admin/, log.string, "Should log removed attributes: #{log.string}") end |