about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-01-23 21:27:26 +0100
committerEugen Rochko <eugen@zeonfederated.com>2020-01-23 21:27:26 +0100
commita8e46cf7a16857d6983c5c1878ab9914d3203f2b (patch)
treed7c2af2a7e05ac69aadb3256732f7c7c0f531cc7 /spec
parentc0006a004d0e58bb3ad356759c17e60f28975b61 (diff)
Add support for magnet: URIs (#12905)
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/formatter_spec.rb8
1 files changed, 8 insertions, 0 deletions
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