projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'feature/unrepeats' into 'develop'
[akkoma]
/
test
/
web
/
oauth
/
authorization_test.exs
diff --git
a/test/web/oauth/authorization_test.exs
b/test/web/oauth/authorization_test.exs
index 52441fa7d17fcbdc895faf32ac2510cbee8ce6d5..4a9e2a3acf105244ca6bf3961de13ea465de9db3 100644
(file)
--- a/
test/web/oauth/authorization_test.exs
+++ b/
test/web/oauth/authorization_test.exs
@@
-4,7
+4,15
@@
defmodule Pleroma.Web.OAuth.AuthorizationTest do
import Pleroma.Factory
test "create an authorization token for a valid app" 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)
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
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)
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,
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
}
token: "mytoken",
used: false
}