File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,20 @@ defmodule M51.FormatTest do
191191 "https://example.org/_matrix/media/r0/download/example.org/foo"
192192 end
193193
194+ test "Matrix link to IRC (connection error on well-known)" do
195+ MockHTTPoison
196+ |> expect ( :get , 1 , fn url ->
197+ assert url == "https://example.org/.well-known/matrix/client"
198+ { :error , % HTTPoison.Error { reason: :connrefused } }
199+ end )
200+
201+ # can log "failed with connection error [connrefused]" warning
202+ Logger . remove_backend ( :console )
203+ assert M51.Format . matrix2irc ( ~s( <img src="mxc://example.org/foo" />) ) ==
204+ "https://example.org/_matrix/media/r0/download/example.org/foo"
205+ Logger . add_backend ( :console )
206+ end
207+
194208 test "IRC link to Matrix" do
195209 assert M51.Format . irc2matrix ( "foo https://example.org" ) ==
196210 { "foo https://example.org" ,
You can’t perform that action at this time.
0 commit comments