Merge commit '0ad2413b35287958f59073a5b63aecc659a64d98' into glitch-soc/merge-upstream

Conflicts:
- `app/javascript/styles/mastodon/forms.scss`:
  Conflict because we ran eslint autofix on upstream files.
- `config/initializers/content_security_policy.rb`:
  Code style changes but we have a different version.
  Kept our version.
- `streaming/index.js`:
  Upstream fixed a typo close to glitch-soc-only code.
  Applied upstream's changes.
This commit is contained in:
Claire
2023-05-08 15:28:36 +02:00
209 changed files with 987 additions and 1098 deletions

View File

@@ -951,10 +951,10 @@ RSpec.describe Account, type: :model do
end
context 'when is local' do
# Test disabled because test environment omits autogenerating keys for performance
xit 'generates keys' do
it 'generates keys' do
account = Account.create!(domain: nil, username: Faker::Internet.user_name(separators: ['_']))
expect(account.keypair.private?).to be true
expect(account.keypair).to be_private
expect(account.keypair).to be_public
end
end

View File

@@ -527,6 +527,28 @@ RSpec.describe User, type: :model do
end
describe '.those_who_can' do
pending
let!(:moderator_user) { Fabricate(:user, role: UserRole.find_by(name: 'Moderator')) }
context 'when there are not any user roles' do
before { UserRole.destroy_all }
it 'returns an empty list' do
expect(User.those_who_can(:manage_blocks)).to eq([])
end
end
context 'when there are not users with the needed role' do
it 'returns an empty list' do
expect(User.those_who_can(:manage_blocks)).to eq([])
end
end
context 'when there are users with roles' do
let!(:admin_user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
it 'returns the users with the role' do
expect(User.those_who_can(:manage_blocks)).to eq([admin_user])
end
end
end
end