Sha256: 0c555226933ee967f4e65f6b7fdf13628a3aaf822bb3adb0c1ab3e6ec63690ab
Contents?: true
Size: 838 Bytes
Versions: 15
Compression:
Stored size: 838 Bytes
Contents
shared_examples_for 'a super_admin authorizer' do context 'when user is an admin' do let(:user) { FactoryGirl.create(:g5_authenticatable_admin) } it 'denies access' do expect(policy).to_not permit(user, record) end end context 'when user is an editor' do let(:user) { FactoryGirl.create(:g5_authenticatable_editor) } it 'denies access' do expect(policy).to_not permit(user, record) end end context 'when user is a viewer' do let(:user) { FactoryGirl.create(:g5_authenticatable_user) } it 'denies access' do expect(policy).to_not permit(user, record) end end context 'when user has super_admin role' do let(:user) { FactoryGirl.create(:g5_authenticatable_super_admin) } it 'permits access' do expect(policy).to permit(user, record) end end end
Version data entries
15 entries across 15 versions & 1 rubygems