Fix tests
All checks were successful
All checks were successful
This commit is contained in:
parent
bb6f367d39
commit
f291d9848a
10 changed files with 13 additions and 12 deletions
|
@ -300,7 +300,7 @@ def run(["invite" | rest]) do
|
|||
{:ok, invite} <- UserInviteToken.create_invite(options) do
|
||||
shell_info("Generated user invite token " <> String.replace(invite.invite_type, "_", " "))
|
||||
|
||||
url = ~p[/registration/#{invite.token}]
|
||||
url = url(~p[/registration/#{invite.token}])
|
||||
IO.puts(url)
|
||||
else
|
||||
error ->
|
||||
|
|
|
@ -2449,7 +2449,7 @@ defp validate_rel_me_field(changeset, fields, raw_fields, %User{
|
|||
end
|
||||
|
||||
if is_url(raw_value) do
|
||||
frontend_url = ~p[/#{nickname}]
|
||||
frontend_url = url(~p[/#{nickname}])
|
||||
|
||||
possible_urls = [ap_id, frontend_url]
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ def get_password_reset(conn, %{"nickname" => nickname}) do
|
|||
conn
|
||||
|> json(%{
|
||||
token: token.token,
|
||||
link: ~p[/api/v1/pleroma/password_reset/#{token.token}]
|
||||
link: url(~p[/api/v1/pleroma/password_reset/#{token.token}])
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
@ -33,10 +33,10 @@ def call(conn, _opts) do
|
|||
end
|
||||
|
||||
def route_aliases(%{path_info: ["objects", id], query_string: query_string}) do
|
||||
ap_id = ~p[/objects/#{id}]
|
||||
ap_id = url(~p[/objects/#{id}])
|
||||
|
||||
with %Activity{} = activity <- Activity.get_by_object_ap_id_with_object(ap_id) do
|
||||
["/notice/#{activity.id}", "/notice/#{activity.id}?#{query_string}"]
|
||||
[~p"/notice/#{activity.id}", "/notice/#{activity.id}?#{query_string}"]
|
||||
else
|
||||
_ -> []
|
||||
end
|
||||
|
|
|
@ -110,7 +110,7 @@ def show(%{assigns: %{username_or_id: username_or_id, tab: tab}} = conn, params)
|
|||
end
|
||||
|
||||
def show(%{assigns: %{object_id: _}} = conn, _params) do
|
||||
url = conn.url <> conn.request_path
|
||||
url = unverified_url(conn, conn.request_path)
|
||||
|
||||
case Activity.get_create_by_object_ap_id_with_object(url) do
|
||||
%Activity{} = activity ->
|
||||
|
@ -123,7 +123,7 @@ def show(%{assigns: %{object_id: _}} = conn, _params) do
|
|||
end
|
||||
|
||||
def show(%{assigns: %{activity_id: _}} = conn, _params) do
|
||||
url = conn.url <> conn.request_path
|
||||
url = unverified_url(conn, conn.request_path)
|
||||
|
||||
case Activity.get_by_ap_id(url) do
|
||||
%Activity{} = activity ->
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
<%= submit Gettext.dpgettext("static_pages", "mfa recover verify recovery code button", "Verify") %>
|
||||
<% end %>
|
||||
<a href="<%= ~p"/oauth/mfa?#{[%{challenge_type: "totp", mfa_token: @mfa_token, state: @state, redirect_uri: @redirect_uri}]}" %>">
|
||||
<a href="<%= ~p"/oauth/mfa?#{[challenge_type: "totp", mfa_token: @mfa_token, state: @state, redirect_uri: @redirect_uri]}" %>">
|
||||
<%= Gettext.dpgettext("static_pages", "mfa recover use 2fa code link", "Enter a two-factor code") %>
|
||||
</a>
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
<%= submit Gettext.dpgettext("static_pages", "mfa auth verify code button", "Verify") %>
|
||||
<% end %>
|
||||
<a href="<%= ~p"/oauth/mfa?#{[%{challenge_type: "recovery", mfa_token: @mfa_token, state: @state, redirect_uri: @redirect_uri}]}" %>">
|
||||
<a href="<%= ~p"/oauth/mfa?#{[challenge_type: "recovery", mfa_token: @mfa_token, state: @state, redirect_uri: @redirect_uri]}" %>">
|
||||
<%= Gettext.dpgettext("static_pages", "mfa auth page use recovery code link", "Enter a two-factor recovery code") %>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -783,7 +783,8 @@ test "it confirms emails of two users", %{conn: conn, admin: admin} do
|
|||
|
||||
describe "PATCH /resend_confirmation_email" do
|
||||
test "it resend emails for two users", %{conn: conn, admin: admin} do
|
||||
[first_user, second_user] = insert_pair(:user, is_confirmed: false)
|
||||
[first_user, second_user] =
|
||||
insert_pair(:user, is_confirmed: false, confirmation_token: "something")
|
||||
|
||||
ret_conn =
|
||||
patch(conn, "/api/v1/pleroma/admin/users/resend_confirmation_email", %{
|
||||
|
|
|
@ -529,7 +529,7 @@ test "update fields with a link to content with rel=me, with frontend path", %{
|
|||
user: user,
|
||||
conn: conn
|
||||
} do
|
||||
fe_url = "#{Pleroma.Web.Endpoint.url()}/#{user.nickname}"
|
||||
fe_url = url(~p[/#{user.nickname}])
|
||||
|
||||
Tesla.Mock.mock(fn
|
||||
%{url: "http://example.com/rel_me/fe_path"} ->
|
||||
|
|
|
@ -258,7 +258,7 @@ test "a note activity" do
|
|||
expected = %{
|
||||
id: to_string(note.id),
|
||||
uri: object_data["id"],
|
||||
url: ~p[/notice/#{note}],
|
||||
url: url(~p[/notice/#{note}]),
|
||||
account: AccountView.render("show.json", %{user: user, skip_visibility_check: true}),
|
||||
in_reply_to_id: nil,
|
||||
in_reply_to_account_id: nil,
|
||||
|
|
Loading…
Reference in a new issue