Add role-specific user fabricators (#33437)
This commit is contained in:
parent
a8a16695f1
commit
7cbdcd7b3f
105 changed files with 125 additions and 113 deletions
|
@ -5,7 +5,7 @@ require 'rails_helper'
|
|||
RSpec.describe AccountPolicy do
|
||||
subject { described_class }
|
||||
|
||||
let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account }
|
||||
let(:admin) { Fabricate(:admin_user).account }
|
||||
let(:john) { Fabricate(:account) }
|
||||
let(:alice) { Fabricate(:account) }
|
||||
|
||||
|
@ -70,7 +70,7 @@ RSpec.describe AccountPolicy do
|
|||
end
|
||||
|
||||
permissions :suspend?, :silence? do
|
||||
let(:staff) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account }
|
||||
let(:staff) { Fabricate(:admin_user).account }
|
||||
|
||||
context 'when staff' do
|
||||
context 'when record is staff' do
|
||||
|
@ -94,7 +94,7 @@ RSpec.describe AccountPolicy do
|
|||
end
|
||||
|
||||
permissions :memorialize? do
|
||||
let(:other_admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account }
|
||||
let(:other_admin) { Fabricate(:admin_user).account }
|
||||
|
||||
context 'when admin' do
|
||||
context 'when record is admin' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue