StatusControllerTest: test creating a quote post
This commit is contained in:
parent
c20e90e898
commit
3a8b5d90df
|
@ -125,6 +125,25 @@ test "posting a status", %{conn: conn} do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "posting a quote post", %{conn: conn} do
|
||||||
|
user = insert(:user)
|
||||||
|
|
||||||
|
{:ok, %{id: activity_id}} = CommonAPI.post(user, %{status: "yolo"})
|
||||||
|
|
||||||
|
conn =
|
||||||
|
conn
|
||||||
|
|> put_req_header("content-type", "application/json")
|
||||||
|
|> post("/api/v1/statuses", %{
|
||||||
|
"status" => "indeed",
|
||||||
|
"quote_id" => activity_id
|
||||||
|
})
|
||||||
|
|
||||||
|
assert %{"id" => id, "pleroma" => %{"quote" => %{"id" => ^activity_id}}} =
|
||||||
|
json_response_and_validate_schema(conn, 200)
|
||||||
|
|
||||||
|
assert Activity.get_by_id(id)
|
||||||
|
end
|
||||||
|
|
||||||
test "it fails to create a status if `expires_in` is less or equal than an hour", %{
|
test "it fails to create a status if `expires_in` is less or equal than an hour", %{
|
||||||
conn: conn
|
conn: conn
|
||||||
} do
|
} do
|
||||||
|
|
Loading…
Reference in New Issue