闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
727 B

  1. require 'rails_helper'
  2. RSpec.describe AtomSerializer do
  3. describe '#author' do
  4. it 'returns dumpable XML with emojis' do
  5. account = Fabricate(:account, display_name: '💩')
  6. xml = AtomSerializer.render(AtomSerializer.new.author(account))
  7. expect(xml).to be_a String
  8. expect(xml).to match(/<poco:displayName>💩<\/poco:displayName>/)
  9. end
  10. it 'returns dumpable XML with invalid characters like \b and \v' do
  11. account = Fabricate(:account, display_name: "im l33t\b haxo\b\vr")
  12. xml = AtomSerializer.render(AtomSerializer.new.author(account))
  13. expect(xml).to be_a String
  14. expect(xml).to match(/<poco:displayName>im l33t haxor<\/poco:displayName>/)
  15. end
  16. end
  17. end