Merge commit 'f877aa9d70d0d600961989b8e97c0e0ce3ac1db6' into glitch-soc/merge-upstream

Conflicts:
- `.github/dependabot.yml`:
  Upstream made changes, but we had removed it.
  Discarded upstream changes.
- `.rubocop_todo.yml`:
  Upstream regenerated the file, we had some glitch-soc-specific ignores.
- `app/models/account_statuses_filter.rb`:
  Minor upstream code style change where glitch-soc had slightly different code
  due to handling of local-only posts.
  Updated to match upstream's code style.
- `app/models/status.rb`:
  Upstream moved ActiveRecord callback definitions, glitch-soc had an extra one.
  Moved the definitions as upstream did.
- `app/services/backup_service.rb`:
  Upstream rewrote a lot of the backup service, glitch-soc had changes because
  of exporting local-only posts.
  Took upstream changes and added back code to deal with local-only posts.
- `config/routes.rb`:
  Upstream split the file into different files, while glitch-soc had a few
  extra routes.
  Extra routes added to `config/routes/settings.rb`, `config/routes/api.rb`
  and `config/routes/admin.rb`
- `db/schema.rb`:
  Upstream has new migrations, while glitch-soc had an extra migration.
  Updated the expected serial number to match upstream's.
- `lib/mastodon/version.rb`:
  Upstream added support to set version tags from environment variables, while
  glitch-soc has an extra `+glitch` tag.
  Changed the code to support upstream's feature but prepending a `+glitch`.
- `spec/lib/activitypub/activity/create_spec.rb`:
  Minor code style change upstream, while glitch-soc has extra tests due to
  `directMessage` handling.
  Applied upstream's changes while keeping glitch-soc's extra tests.
- `spec/models/concerns/account_interactions_spec.rb`:
  Minor code style change upstream, while glitch-soc has extra tests.
  Applied upstream's changes while keeping glitch-soc's extra tests.
This commit is contained in:
Claire
2023-05-08 19:05:55 +02:00
429 changed files with 6138 additions and 3323 deletions

View File

@@ -14,7 +14,7 @@ RSpec.describe DisallowedHashtagsValidator, type: :validator do
let(:status) { double(errors: errors, local?: local, reblog?: reblog, text: disallowed_tags.map { |x| "##{x}" }.join(' ')) }
let(:errors) { double(add: nil) }
context 'for a remote reblog' do
context 'with a remote reblog' do
let(:local) { false }
let(:reblog) { true }
@@ -23,7 +23,7 @@ RSpec.describe DisallowedHashtagsValidator, type: :validator do
end
end
context 'for a local original status' do
context 'with a local original status' do
let(:local) { true }
let(:reblog) { false }

View File

@@ -6,7 +6,7 @@ describe EmailMxValidator do
describe '#validate' do
let(:user) { double(email: 'foo@example.com', sign_up_ip: '1.2.3.4', errors: double(add: nil)) }
context 'for an e-mail domain that is explicitly allowed' do
context 'with an e-mail domain that is explicitly allowed' do
around do |block|
tmp = Rails.configuration.x.email_domains_whitelist
Rails.configuration.x.email_domains_whitelist = 'example.com'

View File

@@ -18,7 +18,7 @@ RSpec.describe FollowLimitValidator, type: :validator do
let(:_nil) { true }
let(:local) { false }
context 'follow.account.nil? || !follow.account.local?' do
context 'with follow.account.nil? || !follow.account.local?' do
let(:_nil) { true }
it 'not calls errors.add' do
@@ -26,11 +26,11 @@ RSpec.describe FollowLimitValidator, type: :validator do
end
end
context '!(follow.account.nil? || !follow.account.local?)' do
context 'with !(follow.account.nil? || !follow.account.local?)' do
let(:_nil) { false }
let(:local) { true }
context 'limit_reached?' do
context 'when limit_reached?' do
let(:limit_reached) { true }
it 'calls errors.add' do
@@ -39,7 +39,7 @@ RSpec.describe FollowLimitValidator, type: :validator do
end
end
context '!limit_reached?' do
context 'with !limit_reached?' do
let(:limit_reached) { false }
it 'not calls errors.add' do

View File

@@ -18,7 +18,7 @@ RSpec.describe PollValidator, type: :validator do
expect(errors).to_not have_received(:add)
end
context 'expires just 5 min ago' do
context 'when expires is just 5 min ago' do
let(:expires_at) { 5.minutes.from_now }
it 'not calls errors add' do

View File

@@ -20,7 +20,7 @@ RSpec.describe StatusPinValidator, type: :validator do
let(:reblog) { false }
let(:count) { 0 }
context 'pin.status.reblog?' do
context 'when pin.status.reblog?' do
let(:reblog) { true }
it 'calls errors.add' do
@@ -28,7 +28,7 @@ RSpec.describe StatusPinValidator, type: :validator do
end
end
context 'pin.account_id != pin.status.account_id' do
context 'when pin.account_id != pin.status.account_id' do
let(:pin_account_id) { 1 }
let(:status_account_id) { 2 }
@@ -37,7 +37,7 @@ RSpec.describe StatusPinValidator, type: :validator do
end
end
context 'if pin.status.direct_visibility?' do
context 'when pin.status.direct_visibility?' do
let(:visibility) { 'direct' }
it 'calls errors.add' do
@@ -45,7 +45,7 @@ RSpec.describe StatusPinValidator, type: :validator do
end
end
context 'pin.account.status_pins.count > 4 && pin.account.local?' do
context 'when pin.account.status_pins.count > 4 && pin.account.local?' do
let(:count) { 5 }
let(:local) { true }

View File

@@ -13,7 +13,7 @@ RSpec.describe UnreservedUsernameValidator, type: :validator do
let(:account) { double(username: username, errors: errors) }
let(:errors) { double(add: nil) }
context '@username.blank?' do
context 'when @username is blank?' do
let(:username) { nil }
it 'not calls errors.add' do
@@ -21,10 +21,10 @@ RSpec.describe UnreservedUsernameValidator, type: :validator do
end
end
context '!@username.blank?' do
context 'when @username is not blank?' do
let(:username) { 'f' }
context 'reserved_username?' do
context 'with reserved_username?' do
let(:reserved_username) { true }
it 'calls errors.add' do
@@ -32,7 +32,7 @@ RSpec.describe UnreservedUsernameValidator, type: :validator do
end
end
context '!reserved_username?' do
context 'when username is not reserved' do
let(:reserved_username) { false }
it 'not calls errors.add' do

View File

@@ -15,7 +15,7 @@ RSpec.describe URLValidator, type: :validator do
let(:value) { '' }
let(:attribute) { :foo }
context 'unless compliant?' do
context 'when not compliant?' do
let(:compliant) { false }
it 'calls errors.add' do
@@ -23,7 +23,7 @@ RSpec.describe URLValidator, type: :validator do
end
end
context 'if compliant?' do
context 'when compliant?' do
let(:compliant) { true }
it 'not calls errors.add' do