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

Conflicts:
- `app/controllers/auth/setup_controller.rb`:
  Upstream removed a method close to a glitch-soc theming-related method.
  Removed the method like upstream did.
This commit is contained in:
Claire
2023-04-22 10:06:11 +02:00
120 changed files with 919 additions and 402 deletions

View File

@@ -44,4 +44,23 @@ describe AccountFilter do
expect(filter.results).to match_array [remote_account_one]
end
end
describe 'with username' do
let!(:local_account) { Fabricate(:account, domain: nil, username: 'validUserName') }
it 'works with @ at the beginning of the username' do
filter = described_class.new(username: '@validUserName')
expect(filter.results).to match_array [local_account]
end
it 'does not work with more than one @ at the beginning of the username' do
filter = described_class.new(username: '@@validUserName')
expect(filter.results).to_not match_array [local_account]
end
it 'does not work with @ outside the beginning of the username' do
filter = described_class.new(username: 'validUserName@')
expect(filter.results).to_not match_array [local_account]
end
end
end