mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
Refactor roles
This commit is contained in:
parent
b527221baf
commit
b0eb6798b0
16 changed files with 155 additions and 223 deletions
|
@ -2,8 +2,6 @@ require 'rails_helper'
|
|||
require 'cancan/matchers'
|
||||
|
||||
describe User do
|
||||
it { should belong_to(:role) }
|
||||
|
||||
describe 'abilities' do
|
||||
subject(:ability) { Ability.new(user) }
|
||||
let(:user) { nil }
|
||||
|
@ -29,7 +27,7 @@ describe User do
|
|||
end
|
||||
|
||||
context 'when user is customer service' do
|
||||
let(:user) { Fabricate(:user, role: Role.new(code: 'customer_service')) }
|
||||
let(:user) { Fabricate(:user, roles: ['customer_service']) }
|
||||
|
||||
it { should be_able_to(:manage, Domain.new) }
|
||||
it { should be_able_to(:manage, Contact.new) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue