aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/mass_assignment_security/black_list_test.rb
blob: 0ec7f8719c080da7075f0cb8c1d9cf77c756f05e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "cases/helper"

class BlackListTest < ActiveModel::TestCase

  def setup
    @black_list   = ActiveModel::MassAssignmentSecurity::BlackList.new
    @included_key = 'admin'
    @black_list  += [ @included_key ]
  end

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

  test "deny? is false for non-included items" do
    assert_equal false, @black_list.deny?('first_name')
  end


end