Format the code.
This commit is contained in:
parent
480932c8e5
commit
4afbef39f4
111 changed files with 4912 additions and 2769 deletions
|
|
@ -4,7 +4,15 @@ defmodule Pleroma.Web.OAuth.AuthorizationTest do
|
|||
import Pleroma.Factory
|
||||
|
||||
test "create an authorization token for a valid app" do
|
||||
{:ok, app} = Repo.insert(App.register_changeset(%App{}, %{client_name: "client", scopes: "scope", redirect_uris: "url"}))
|
||||
{:ok, app} =
|
||||
Repo.insert(
|
||||
App.register_changeset(%App{}, %{
|
||||
client_name: "client",
|
||||
scopes: "scope",
|
||||
redirect_uris: "url"
|
||||
})
|
||||
)
|
||||
|
||||
user = insert(:user)
|
||||
|
||||
{:ok, auth} = Authorization.create_authorization(app, user)
|
||||
|
|
@ -16,7 +24,15 @@ defmodule Pleroma.Web.OAuth.AuthorizationTest do
|
|||
end
|
||||
|
||||
test "use up a token" do
|
||||
{:ok, app} = Repo.insert(App.register_changeset(%App{}, %{client_name: "client", scopes: "scope", redirect_uris: "url"}))
|
||||
{:ok, app} =
|
||||
Repo.insert(
|
||||
App.register_changeset(%App{}, %{
|
||||
client_name: "client",
|
||||
scopes: "scope",
|
||||
redirect_uris: "url"
|
||||
})
|
||||
)
|
||||
|
||||
user = insert(:user)
|
||||
|
||||
{:ok, auth} = Authorization.create_authorization(app, user)
|
||||
|
|
@ -30,7 +46,7 @@ defmodule Pleroma.Web.OAuth.AuthorizationTest do
|
|||
expired_auth = %Authorization{
|
||||
user_id: user.id,
|
||||
app_id: app.id,
|
||||
valid_until: NaiveDateTime.add(NaiveDateTime.utc_now, -10),
|
||||
valid_until: NaiveDateTime.add(NaiveDateTime.utc_now(), -10),
|
||||
token: "mytoken",
|
||||
used: false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue