Sha256: 5aa4ee8d547a307a01f12ba605b017e68b7438701366f5f85e91d3e4c2f4f0cf

Contents?: true

Size: 449 Bytes

Versions: 6

Compression:

Stored size: 449 Bytes

Contents

require "test_helper"

class WhiteListTest < ActiveModel::TestCase

  def setup
    @white_list   = ActiveModel::MassAssignmentSecurity::WhiteList.new
    @included_key = 'first_name'
    @white_list  += [ @included_key ]
  end

  test "deny? is false for included items" do
    assert_equal false, @white_list.deny?(@included_key)
  end

  test "deny? is true for non-included items" do
    assert_equal true, @white_list.deny?('admin')
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
protected_attributes-1.0.5 test/mass_assignment_security/white_list_test.rb
protected_attributes-1.0.4 test/mass_assignment_security/white_list_test.rb
protected_attributes-1.0.3 test/mass_assignment_security/white_list_test.rb
protected_attributes-1.0.2 test/mass_assignment_security/white_list_test.rb
protected_attributes-1.0.1 test/mass_assignment_security/white_list_test.rb
protected_attributes-1.0.0 test/mass_assignment_security/white_list_test.rb