[#2068] Introduced proper OAuth tokens usage to controller tests.
This commit is contained in:
parent
7973cbdb9f
commit
455e072d27
23 changed files with 548 additions and 1045 deletions
|
|
@ -30,14 +30,14 @@ defmodule Pleroma.Web.ConnCase do
|
|||
@endpoint Pleroma.Web.Endpoint
|
||||
|
||||
# Sets up OAuth access with specified scopes
|
||||
defp oauth_access(scopes, opts \\ %{}) do
|
||||
defp oauth_access(scopes, opts \\ []) do
|
||||
user =
|
||||
Map.get_lazy(opts, :user, fn ->
|
||||
Keyword.get_lazy(opts, :user, fn ->
|
||||
Pleroma.Factory.insert(:user)
|
||||
end)
|
||||
|
||||
token =
|
||||
Map.get_lazy(opts, :oauth_token, fn ->
|
||||
Keyword.get_lazy(opts, :oauth_token, fn ->
|
||||
Pleroma.Factory.insert(:oauth_token, user: user, scopes: scopes)
|
||||
end)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue