Merge remote-tracking branch 'parent/main' into upstream-20240109

This commit is contained in:
KMY 2025-01-09 13:20:56 +09:00
commit d35fa72842
333 changed files with 4444 additions and 2541 deletions

View file

@ -633,7 +633,7 @@ RSpec.describe User do
end
describe '.those_who_can' do
before { Fabricate(:user, role: UserRole.find_by(name: 'Moderator')) }
before { Fabricate(:moderator_user) }
context 'when there are not any user roles' do
before { UserRole.destroy_all }
@ -650,7 +650,7 @@ RSpec.describe User do
end
context 'when there are users with roles' do
let!(:admin_user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
let!(:admin_user) { Fabricate(:admin_user) }
it 'returns the users with the role' do
expect(described_class.those_who_can(:manage_blocks)).to eq([admin_user])