about summary refs log tree commit diff
path: root/spec/lib
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-06-19 16:19:32 +0200
committerThibaut Girka <thib@sitedethib.com>2019-06-19 18:36:16 +0200
commit356e9150dfec5bbb8a56b128c1d3372cd5731ec6 (patch)
treeb5270b3fe3c38ef2d94670f06613c4bdf71d0631 /spec/lib
parentf4b008906dcfc3333ec533884aa10b65f8ae41a2 (diff)
parentede0be5dba6836606db772a007ad9be5d60c7b99 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- app/lib/sanitize_config.rb
  Keep our version, we support the tags upstream transforms.
- package.json
- yarn.lock
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/sanitize_config_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/sanitize_config_spec.rb b/spec/lib/sanitize_config_spec.rb
new file mode 100644
index 000000000..c5143bcef
--- /dev/null
+++ b/spec/lib/sanitize_config_spec.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+require Rails.root.join('app', 'lib', 'sanitize_config.rb')
+
+describe Sanitize::Config do
+  describe '::MASTODON_STRICT' do
+    subject { Sanitize::Config::MASTODON_STRICT }
+
+    it 'keeps h1' do
+      expect(Sanitize.fragment('<h1>Foo</h1>', subject)).to eq '<h1>Foo</h1>'
+    end
+
+    it 'keeps ul' do
+      expect(Sanitize.fragment('<p>Check out:</p><ul><li>Foo</li><li>Bar</li></ul>', subject)).to eq '<p>Check out:</p><ul><li>Foo</li><li>Bar</li></ul>'
+    end
+  end
+end