diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-03-28 20:51:51 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-03-28 22:21:37 +0200 |
commit | 61cefbebf717326bd6ec3923e67e3702a24a0b24 (patch) | |
tree | 99b7b8816739be2701d8629b4cb6d7fb4423e135 /spec/lib/sanitize_config_spec.rb | |
parent | f313bf3e97ddd83e7847ae00f5bdb488942c943c (diff) |
Add advanced text formatting back into glitch-soc
Diffstat (limited to 'spec/lib/sanitize_config_spec.rb')
-rw-r--r-- | spec/lib/sanitize_config_spec.rb | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/spec/lib/sanitize_config_spec.rb b/spec/lib/sanitize_config_spec.rb index 8bcffb2e5..dc6418e5b 100644 --- a/spec/lib/sanitize_config_spec.rb +++ b/spec/lib/sanitize_config_spec.rb @@ -41,18 +41,8 @@ describe Sanitize::Config do end end - describe '::MASTODON_STRICT' do - subject { Sanitize::Config::MASTODON_STRICT } - - it_behaves_like 'common HTML sanitization' - - it 'keeps a with href and rel tag' do - expect(Sanitize.fragment('<a href="http://example.com" rel="tag">Test</a>', subject)).to eq '<a href="http://example.com" rel="tag nofollow noopener noreferrer" target="_blank">Test</a>' - end - end - - describe '::MASTODON_STRICT with outgoing toots' do - subject { Sanitize::Config::MASTODON_STRICT.merge(outgoing: true) } + describe '::MASTODON_OUTGOING' do + subject { Sanitize::Config::MASTODON_OUTGOING } around do |example| original_web_domain = Rails.configuration.x.web_domain @@ -62,9 +52,9 @@ describe Sanitize::Config do it_behaves_like 'common HTML sanitization' - it 'keeps a with href and rel tag, not adding to rel if url is local' do + it 'keeps a with href and rel tag, not adding to rel or target if url is local' do Rails.configuration.x.web_domain = 'domain.test' - expect(Sanitize.fragment('<a href="http://domain.test/tags/foo" rel="tag">Test</a>', subject)).to eq '<a href="http://domain.test/tags/foo" rel="tag" target="_blank">Test</a>' + expect(Sanitize.fragment('<a href="http://domain.test/tags/foo" rel="tag">Test</a>', subject)).to eq '<a href="http://domain.test/tags/foo" rel="tag">Test</a>' end end end |