diff options
author | Starfall <us@starfall.systems> | 2023-04-22 20:32:00 -0500 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2023-04-22 20:32:00 -0500 |
commit | 609ee7b2979252464e63acbfd2eff3e0e3786f3e (patch) | |
tree | 6ade160c4354b803ed36ae5dae28a0ae38bcf032 /spec/models | |
parent | 4fe1689de43f4404eb9530fcfbcbfb26d6c1c13a (diff) | |
parent | 5b58ebb04fe197cc7aa0cfc05a4d1b2df8da0050 (diff) |
Merge remote-tracking branch 'glitch/main'
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/account_filter_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/models/account_filter_spec.rb b/spec/models/account_filter_spec.rb index 3032260fe..cb00e7609 100644 --- a/spec/models/account_filter_spec.rb +++ b/spec/models/account_filter_spec.rb @@ -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 |