mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-21 12:05:07 +01:00
Add forgotten AtomSerializer spec (#2047)
This commit is contained in:
parent
8d3412c90c
commit
f03fb6c0ae
21
spec/lib/atom_serializer_spec.rb
Normal file
21
spec/lib/atom_serializer_spec.rb
Normal file
@ -0,0 +1,21 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe AtomSerializer do
|
||||
describe '#author' do
|
||||
it 'returns dumpable XML with emojis' do
|
||||
account = Fabricate(:account, display_name: '💩')
|
||||
xml = AtomSerializer.render(AtomSerializer.new.author(account))
|
||||
|
||||
expect(xml).to be_a String
|
||||
expect(xml).to match(/<poco:displayName>💩<\/poco:displayName>/)
|
||||
end
|
||||
|
||||
it 'returns dumpable XML with invalid characters like \b and \v' do
|
||||
account = Fabricate(:account, display_name: "im l33t\b haxo\b\vr")
|
||||
xml = AtomSerializer.render(AtomSerializer.new.author(account))
|
||||
|
||||
expect(xml).to be_a String
|
||||
expect(xml).to match(/<poco:displayName>im l33t haxor<\/poco:displayName>/)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user