Sha256: d5ac0ba333cdcf88a30c4ed03fe374a7b6f859260ccffbf1554de8c942b47f0b

Contents?: true

Size: 912 Bytes

Versions: 37

Compression:

Stored size: 912 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe RoleMapper do
  
 it "should define the 4 roles" do
   RoleMapper.role_names.sort.should == %w(admin_policy_object_editor archivist donor patron researcher) 
 end
 it "should quer[iy]able for roles for a given user" do
   RoleMapper.roles('leland_himself@example.com').sort.should == ['archivist', 'donor', 'patron']
   RoleMapper.roles('archivist2@example.com').should == ['archivist']
 end

 it "should return an empty array if there are no roles" do
   RoleMapper.roles('zeus@olympus.mt').empty?.should == true
 end
 it "should know who is what" do
   RoleMapper.whois('archivist').sort.should == %w(archivist1@example.com archivist2@example.com leland_himself@example.com)
   RoleMapper.whois('salesman').empty?.should == true
   RoleMapper.whois('admin_policy_object_editor').sort.should == %w(archivist1@example.com)
 end

end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
hydra-head-4.0.3 test_support/spec/models/role_mapper_spec.rb
hydra-head-4.0.2 test_support/spec/models/role_mapper_spec.rb
hydra-head-4.0.1 test_support/spec/models/role_mapper_spec.rb
hydra-head-4.0.0 test_support/spec/models/role_mapper_spec.rb
hydra-head-4.0.0.rc6 test_support/spec/models/role_mapper_spec.rb
hydra-head-4.0.0.rc5 test_support/spec/models/role_mapper_spec.rb
hydra-head-4.0.0.rc4 test_support/spec/models/role_mapper_spec.rb
hydra-head-4.0.0.rc3 test_support/spec/models/role_mapper_spec.rb
hydra-head-4.0.0.rc2 test_support/spec/models/role_mapper_spec.rb
hydra-head-3.3.0 test_support/spec/models/role_mapper_spec.rb
hydra-head-3.2.2 test_support/spec/models/role_mapper_spec.rb
hydra-head-3.2.1 test_support/spec/models/role_mapper_spec.rb
hydra-head-3.2.0 test_support/spec/models/role_mapper_spec.rb
hydra-head-3.2.0.pre3 test_support/spec/models/role_mapper_spec.rb
hydra-head-3.2.0.pre2 test_support/spec/models/role_mapper_spec.rb
hydra-head-3.2.0.pre1 test_support/spec/models/role_mapper_spec.rb
hydra-head-3.1.5 test_support/spec/models/role_mapper_spec.rb
hydra-head-3.1.4 test_support/spec/models/role_mapper_spec.rb
hydra-head-3.1.3 test_support/spec/models/role_mapper_spec.rb
hydra-head-3.1.2 test_support/spec/models/role_mapper_spec.rb