Merge branch 'main' into glitch-soc/merge-upstream

Conflicts:
- `.github/dependabot.yml`:
  Upstream made changes while we have dropped this file.
  Keep the file deleted.
- `.prettierignore`:
  Upstream made changes at the end of the file, where we
  had our extra lines.
  Just moved our extra lines back at the end.
- `app/serializers/initial_state_serializer.rb`:
  Upstream code style changes.
  Applied them.
- `app/services/backup_service.rb`:
  Upstream code style changes.
  Applied them.
This commit is contained in:
Claire
2023-02-19 10:42:55 +01:00
391 changed files with 6713 additions and 3145 deletions

View File

@@ -15,7 +15,7 @@ describe NoteLengthValidator do
end
it 'counts URLs as 23 characters flat' do
text = ('a' * 476) + " http://#{'b' * 30}.com/example"
text = ('a' * 476) + " http://#{'b' * 30}.com/example"
account = double(note: text, errors: double(add: nil))
subject.validate_each(account, 'note', text)
@@ -23,7 +23,7 @@ describe NoteLengthValidator do
end
it 'does not count non-autolinkable URLs as 23 characters flat' do
text = ('a' * 476) + "http://#{'b' * 30}.com/example"
text = ('a' * 476) + "http://#{'b' * 30}.com/example"
account = double(note: text, errors: double(add: nil))
subject.validate_each(account, 'note', text)

View File

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

View File

@@ -11,10 +11,10 @@ RSpec.describe UnreservedUsernameValidator, type: :validator do
let(:validator) { described_class.new }
let(:account) { double(username: username, errors: errors) }
let(:errors ) { double(add: nil) }
let(:errors) { double(add: nil) }
context '@username.blank?' do
let(:username) { nil }
let(:username) { nil }
it 'not calls errors.add' do
expect(errors).not_to have_received(:add).with(:username, any_args)
@@ -22,7 +22,7 @@ RSpec.describe UnreservedUsernameValidator, type: :validator do
end
context '!@username.blank?' do
let(:username) { 'f' }
let(:username) { 'f' }
context 'reserved_username?' do
let(:reserved_username) { true }