Sha256: 0358910dd074e6af229de15a2bb3923c69d4b7202b5ae69ce9b368e4b921bc9c

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

require 'test/unit'

class Tc_permission < Test::Unit::TestCase
  def setup
  end

  def teardown
  end

  def test_can_view
    assert Permission.can_view( 'internet', 'Internet'), 'Internet is not allowed'
    assert ( not Permission.can_view( 'internet', 'PersonModify') )
    assert Permission.can_view( 'secretary', 'Internet')
  end
  
  def test_views
    assert_equal %w( View View.Login ), Permission.views( :default )
    assert_equal %w( Internet PersonShow View View.Login ), 
      Permission.views( :internet )
    assert_equal %w( Internet PersonShow View View.Login ), 
      Permission.views( %w( internet default ) )
  end

  def test_has_role
    assert Permission.has_role( 'professor', 'professor' )
    assert ! Permission.has_role( 'professo', 'professor' )
    assert ! Permission.has_role( 'rofessor', 'professor' )
    assert Permission.has_role( 'admin', 'professor' )
    assert ! Permission.has_role( 'student', 'professor' )
    assert Permission.has_role( %w( professor secretary ), 'cybermanager' )
    assert Permission.has_role( %w( secretary professor ), 'cybermanager' )
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
qooxview-1.9.1312 test/qv_permission.rb
qooxview-1.9.13.pre.12 test/qv_permission.rb
qooxview-1.9.13.pre.11 test/qv_permission.rb
qooxview-1.9.13.pre.10 test/qv_permission.rb
qooxview-1.9.11 test/qv_permission.rb
qooxview-1.9.10 test/qv_permission.rb
qooxview-1.9.9 test/qv_permission.rb