Skip to content
Snippets Groups Projects
Commit f03fb6c0 authored by Eugen's avatar Eugen Committed by GitHub
Browse files

Add forgotten AtomSerializer spec (#2047)

parent 8d3412c9
No related branches found
No related tags found
No related merge requests found
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment