Fix warnings
This commit is contained in:
parent
64553ebae2
commit
3985c1b450
17 changed files with 33 additions and 33 deletions
|
@ -228,7 +228,7 @@
|
|||
<body>
|
||||
<div class="container">
|
||||
<h1><%= Pleroma.Config.get([:instance, :name]) %></h1>
|
||||
<%= render @view_module, @view_template, assigns %>
|
||||
<%= @inner_content %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= render @view_module, @view_template, assigns %>
|
||||
<%= @inner_content %>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -10,7 +10,7 @@ video, audio {
|
|||
}
|
||||
</style>
|
||||
|
||||
<%= render @view_module, @view_template, assigns %>
|
||||
<%= @inner_content %>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<%= render @view_module, @view_template, assigns %>
|
||||
<%= @inner_content %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -400,7 +400,7 @@ test "dismisses the notification on follow request rejection" do
|
|||
user = insert(:user, locked: true)
|
||||
follower = insert(:user)
|
||||
{:ok, _, _, _follow_activity} = CommonAPI.follow(follower, user)
|
||||
assert [notification] = Notification.for_user(user)
|
||||
assert [_notification] = Notification.for_user(user)
|
||||
{:ok, _follower} = CommonAPI.reject_follow_request(follower, user)
|
||||
assert [] = Notification.for_user(user)
|
||||
end
|
||||
|
|
|
@ -505,22 +505,22 @@ test "increases replies count", %{user: user} do
|
|||
|
||||
# public
|
||||
{:ok, _} = CommonAPI.post(user2, Map.put(reply_data, :visibility, "public"))
|
||||
assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
|
||||
assert %{data: _data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
|
||||
assert object.data["repliesCount"] == 1
|
||||
|
||||
# unlisted
|
||||
{:ok, _} = CommonAPI.post(user2, Map.put(reply_data, :visibility, "unlisted"))
|
||||
assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
|
||||
assert %{data: _data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
|
||||
assert object.data["repliesCount"] == 2
|
||||
|
||||
# private
|
||||
{:ok, _} = CommonAPI.post(user2, Map.put(reply_data, :visibility, "private"))
|
||||
assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
|
||||
assert %{data: _data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
|
||||
assert object.data["repliesCount"] == 2
|
||||
|
||||
# direct
|
||||
{:ok, _} = CommonAPI.post(user2, Map.put(reply_data, :visibility, "direct"))
|
||||
assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
|
||||
assert %{data: _data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
|
||||
assert object.data["repliesCount"] == 2
|
||||
end
|
||||
end
|
||||
|
|
|
@ -21,7 +21,7 @@ test "it's allowed when address is public" do
|
|||
"type" => "Create"
|
||||
}
|
||||
|
||||
assert {:ok, message} = RejectNonPublic.filter(message)
|
||||
assert {:ok, _message} = RejectNonPublic.filter(message)
|
||||
end
|
||||
|
||||
test "it's allowed when cc address contain public address" do
|
||||
|
@ -34,7 +34,7 @@ test "it's allowed when cc address contain public address" do
|
|||
"type" => "Create"
|
||||
}
|
||||
|
||||
assert {:ok, message} = RejectNonPublic.filter(message)
|
||||
assert {:ok, _message} = RejectNonPublic.filter(message)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -50,7 +50,7 @@ test "it's allowed when addrer of message in the follower addresses of user and
|
|||
}
|
||||
|
||||
Pleroma.Config.put([:mrf_rejectnonpublic, :allow_followersonly], true)
|
||||
assert {:ok, message} = RejectNonPublic.filter(message)
|
||||
assert {:ok, _message} = RejectNonPublic.filter(message)
|
||||
end
|
||||
|
||||
test "it's rejected when addrer of message in the follower addresses of user and it disabled in config" do
|
||||
|
@ -80,7 +80,7 @@ test "it's allows when direct messages are allow" do
|
|||
}
|
||||
|
||||
Pleroma.Config.put([:mrf_rejectnonpublic, :allow_direct], true)
|
||||
assert {:ok, message} = RejectNonPublic.filter(message)
|
||||
assert {:ok, _message} = RejectNonPublic.filter(message)
|
||||
end
|
||||
|
||||
test "it's reject when direct messages aren't allow" do
|
||||
|
|
|
@ -29,7 +29,7 @@ test "allows non-local follow requests" do
|
|||
actor = insert(:user, tags: ["mrf_tag:disable-remote-subscription"])
|
||||
follower = insert(:user, tags: ["mrf_tag:disable-remote-subscription"], local: true)
|
||||
message = %{"object" => actor.ap_id, "type" => "Follow", "actor" => follower.ap_id}
|
||||
assert {:ok, message} = TagPolicy.filter(message)
|
||||
assert {:ok, _message} = TagPolicy.filter(message)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ test "it rejects incoming announces with an inlined activity from another origin
|
|||
|
||||
_user = insert(:user, local: false, ap_id: data["actor"])
|
||||
|
||||
assert {:error, e} = Transmogrifier.handle_incoming(data)
|
||||
assert {:error, _e} = Transmogrifier.handle_incoming(data)
|
||||
end
|
||||
|
||||
test "it does not clobber the addressing on announce activities" do
|
||||
|
|
|
@ -101,7 +101,7 @@ test "it fetches reply-to activities if we don't have them" do
|
|||
{:ok, returned_activity} = Transmogrifier.handle_incoming(data)
|
||||
returned_object = Object.normalize(returned_activity, false)
|
||||
|
||||
assert activity =
|
||||
assert %Activity{} =
|
||||
Activity.get_create_by_object_ap_id(
|
||||
"https://mstdn.io/users/mayuutann/statuses/99568293732299394"
|
||||
)
|
||||
|
|
|
@ -622,7 +622,7 @@ test "it validates character limits are correctly enforced" do
|
|||
assert {:error, "The status is over the character limit"} =
|
||||
CommonAPI.post(user, %{status: "foobar"})
|
||||
|
||||
assert {:ok, activity} = CommonAPI.post(user, %{status: "12345"})
|
||||
assert {:ok, _activity} = CommonAPI.post(user, %{status: "12345"})
|
||||
end
|
||||
|
||||
test "it can handle activities that expire" do
|
||||
|
|
|
@ -52,7 +52,7 @@ test "multiple origins can be added" do
|
|||
end
|
||||
|
||||
test "will be ignored" do
|
||||
assert {:ok, %SocketInfo{origin: origin, pid: pid_one}} =
|
||||
assert {:ok, %SocketInfo{origin: origin, pid: _pid_one}} =
|
||||
FedRegistry.get_fed_socket(@good_domain_origin)
|
||||
|
||||
assert origin == "good.domain:80"
|
||||
|
@ -63,7 +63,7 @@ test "will be ignored" do
|
|||
test "the newer process will be closed" do
|
||||
pid_two = build_test_socket(@good_domain)
|
||||
|
||||
assert {:ok, %SocketInfo{origin: origin, pid: pid_one}} =
|
||||
assert {:ok, %SocketInfo{origin: origin, pid: _pid_one}} =
|
||||
FedRegistry.get_fed_socket(@good_domain_origin)
|
||||
|
||||
assert origin == "good.domain:80"
|
||||
|
|
|
@ -32,7 +32,7 @@ test "works by id" do
|
|||
test "works by nickname" do
|
||||
user = insert(:user)
|
||||
|
||||
assert %{"id" => user_id} =
|
||||
assert %{"id" => _user_id} =
|
||||
build_conn()
|
||||
|> get("/api/v1/accounts/#{user.nickname}")
|
||||
|> json_response_and_validate_schema(200)
|
||||
|
@ -43,7 +43,7 @@ test "works by nickname for remote users" do
|
|||
|
||||
user = insert(:user, nickname: "user@example.com", local: false)
|
||||
|
||||
assert %{"id" => user_id} =
|
||||
assert %{"id" => _user_id} =
|
||||
build_conn()
|
||||
|> get("/api/v1/accounts/#{user.nickname}")
|
||||
|> json_response_and_validate_schema(200)
|
||||
|
@ -1429,10 +1429,10 @@ test "returns an error if captcha is invalid", %{conn: conn} do
|
|||
test "returns lists to which the account belongs" do
|
||||
%{user: user, conn: conn} = oauth_access(["read:lists"])
|
||||
other_user = insert(:user)
|
||||
assert {:ok, %Pleroma.List{id: list_id} = list} = Pleroma.List.create("Test List", user)
|
||||
assert {:ok, %Pleroma.List{id: _list_id} = list} = Pleroma.List.create("Test List", user)
|
||||
{:ok, %{following: _following}} = Pleroma.List.follow(list, other_user)
|
||||
|
||||
assert [%{"id" => list_id, "title" => "Test List"}] =
|
||||
assert [%{"id" => _list_id, "title" => "Test List"}] =
|
||||
conn
|
||||
|> get("/api/v1/accounts/#{other_user.id}/lists")
|
||||
|> json_response_and_validate_schema(200)
|
||||
|
|
|
@ -937,7 +937,7 @@ test "reblogged status for another user" do
|
|||
|> get("/api/v1/statuses/#{reblog_activity1.id}")
|
||||
|
||||
assert %{
|
||||
"reblog" => %{"id" => id, "reblogged" => false, "reblogs_count" => 2},
|
||||
"reblog" => %{"id" => _id, "reblogged" => false, "reblogs_count" => 2},
|
||||
"reblogged" => false,
|
||||
"favourited" => false,
|
||||
"bookmarked" => false
|
||||
|
|
|
@ -77,7 +77,7 @@ test "GET /oauth/prepare_request encodes parameters as `state` and redirects", %
|
|||
}
|
||||
)
|
||||
|
||||
assert response = html_response(conn, 302)
|
||||
assert html_response(conn, 302)
|
||||
|
||||
redirect_query = URI.parse(redirected_to(conn)).query
|
||||
assert %{"state" => state_param} = URI.decode_query(redirect_query)
|
||||
|
@ -119,7 +119,7 @@ test "with user-bound registration, GET /oauth/<provider>/callback redirects to
|
|||
}
|
||||
)
|
||||
|
||||
assert response = html_response(conn, 302)
|
||||
assert html_response(conn, 302)
|
||||
assert redirected_to(conn) =~ ~r/#{redirect_uri}\?code=.+/
|
||||
end
|
||||
|
||||
|
@ -182,7 +182,7 @@ test "on authentication error, GET /oauth/<provider>/callback redirects to `redi
|
|||
}
|
||||
)
|
||||
|
||||
assert response = html_response(conn, 302)
|
||||
assert html_response(conn, 302)
|
||||
assert redirected_to(conn) == app.redirect_uris
|
||||
assert get_flash(conn, :error) == "Failed to authenticate: (error description)."
|
||||
end
|
||||
|
@ -238,7 +238,7 @@ test "with valid params, POST /oauth/register?op=register redirects to `redirect
|
|||
}
|
||||
)
|
||||
|
||||
assert response = html_response(conn, 302)
|
||||
assert html_response(conn, 302)
|
||||
assert redirected_to(conn) =~ ~r/#{redirect_uri}\?code=.+/
|
||||
end
|
||||
|
||||
|
@ -268,7 +268,7 @@ test "with unlisted `redirect_uri`, POST /oauth/register?op=register results in
|
|||
}
|
||||
)
|
||||
|
||||
assert response = html_response(conn, 401)
|
||||
assert html_response(conn, 401)
|
||||
end
|
||||
|
||||
test "with invalid params, POST /oauth/register?op=register renders registration_details page",
|
||||
|
@ -336,7 +336,7 @@ test "with valid params, POST /oauth/register?op=connect redirects to `redirect_
|
|||
}
|
||||
)
|
||||
|
||||
assert response = html_response(conn, 302)
|
||||
assert html_response(conn, 302)
|
||||
assert redirected_to(conn) =~ ~r/#{redirect_uri}\?code=.+/
|
||||
end
|
||||
|
||||
|
@ -367,7 +367,7 @@ test "with unlisted `redirect_uri`, POST /oauth/register?op=connect results in H
|
|||
}
|
||||
)
|
||||
|
||||
assert response = html_response(conn, 401)
|
||||
assert html_response(conn, 401)
|
||||
end
|
||||
|
||||
test "with invalid params, POST /oauth/register?op=connect renders registration_details page",
|
||||
|
|
|
@ -569,7 +569,7 @@ test "shows pack.json", %{conn: conn} do
|
|||
|
||||
test "for pack name with special chars", %{conn: conn} do
|
||||
assert %{
|
||||
"files" => files,
|
||||
"files" => _files,
|
||||
"files_count" => 1,
|
||||
"pack" => %{
|
||||
"can-download" => true,
|
||||
|
|
|
@ -34,7 +34,7 @@ test "mascot upload" do
|
|||
|> put_req_header("content-type", "multipart/form-data")
|
||||
|> put("/api/v1/pleroma/mascot", %{"file" => file})
|
||||
|
||||
assert %{"id" => _, "type" => image} = json_response_and_validate_schema(conn, 200)
|
||||
assert %{"id" => _, "type" => _image} = json_response_and_validate_schema(conn, 200)
|
||||
end
|
||||
|
||||
test "mascot retrieving" do
|
||||
|
|
Loading…
Reference in a new issue