Add OAuth tokens endpoint
This commit is contained in:
parent
33f8f3c33a
commit
61a4bc5095
6 changed files with 75 additions and 0 deletions
|
|
@ -1876,4 +1876,22 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
|
|||
ActivityRepresenter.to_map(activity, %{user: user, for: user})
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET /api/oauth_tokens" do
|
||||
test "renders list" do
|
||||
token = insert(:oauth_token)
|
||||
|
||||
response =
|
||||
build_conn()
|
||||
|> assign(:user, Repo.get(User, token.user_id))
|
||||
|> get("/api/oauth_tokens")
|
||||
|
||||
keys =
|
||||
json_response(response, 200)
|
||||
|> hd()
|
||||
|> Map.keys()
|
||||
|
||||
assert keys -- ["id", "refresh_token", "token", "valid_until"] == []
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue