- assert length(subs) == 3
- Enum.each(subs, fn {uuid, _} -> assert String.contains?(text, uuid) end)
+ expected_text =
+ ~s(<span class="h-card"><a data-user="#{gsimg.id}" class="u-url mention" href="#{
+ gsimg.ap_id
+ }" rel="ugc">@<span>gsimg</span></a></span> According to <span class="h-card"><a data-user="#{
+ archaeme.id
+ }" class="u-url mention" href="#{"https://archeme/@archa_eme_"}" rel="ugc">@<span>archa_eme_</span></a></span>, that is @daggsy. Also hello <span class="h-card"><a data-user="#{
+ archaeme_remote.id
+ }" class="u-url mention" href="#{archaeme_remote.ap_id}" rel="ugc">@<span>archaeme</span></a></span>)
+
+ assert expected_text == text
+ end
+
+ test "gives a replacement for user links when the user is using Osada" do
+ {:ok, mike} = User.get_or_fetch("mike@osada.macgirvin.com")
+
+ text = "@mike@osada.macgirvin.com test"
+
+ {text, mentions, []} = Formatter.linkify(text)
+
+ assert length(mentions) == 1