diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-04-22 19:13:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-22 19:13:02 +0200 |
commit | 2ebbfebfe9c7c967e3bcc9da0eec4628f9188233 (patch) | |
tree | ed3fa3f23d520e99fdd8b19597992b59a47aaa7d /spec/models | |
parent | f30c5e7f15f967019245d2c78f3c2e89800eb838 (diff) | |
parent | 9ef32ea570fd0db63bd75714cd847abad6833345 (diff) |
Merge pull request #2192 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
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 |