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