From a8e46cf7a16857d6983c5c1878ab9914d3203f2b Mon Sep 17 00:00:00 2001 From: ThibG Date: Thu, 23 Jan 2020 21:27:26 +0100 Subject: Add support for magnet: URIs (#12905) --- spec/lib/formatter_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec') diff --git a/spec/lib/formatter_spec.rb b/spec/lib/formatter_spec.rb index 83be0a588..633d59c2a 100644 --- a/spec/lib/formatter_spec.rb +++ b/spec/lib/formatter_spec.rb @@ -258,6 +258,14 @@ RSpec.describe Formatter do is_expected.to include 'href="xmpp:muc@instance.com?join"' end end + + context 'given text containing a magnet: URI' do + let(:text) { 'wikipedia gives this example of a magnet uri: magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a' } + + it 'matches the full URI' do + is_expected.to include 'href="magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a"' + end + end end describe '#format_spoiler' do -- cgit