Test that usernames with underscores get linked correctly

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
pull/2433/head
Plastikmensch 2023-10-06 22:32:06 +02:00
parent 41bc94adf8
commit 5930fb7323
No known key found for this signature in database
GPG Key ID: 96381D586F4A6077
1 changed files with 9 additions and 0 deletions

View File

@ -75,6 +75,15 @@ RSpec.describe AdvancedTextFormatter do
it 'creates a mention link' do
expect(subject).to include '<a href="https://cb6e6126.ngrok.io/@alice" class="u-url mention">@<span>alice</span></a></span>'
end
context 'when username contains underscores' do
let(:preloaded_accounts) { [Fabricate(:account, username: '_bob_')] }
let(:text) { '@_bob_' }
it 'creates a mention link' do
expect(subject).to include '<a href="https://cb6e6126.ngrok.io/@_bob_" class="u-url mention">@<span>_bob_</span></a></span>'
end
end
end
context 'with text containing unlinkable mentions' do