View Source MyApp.CharonOauth2.TestSeeds (CharonOauth2 v0.5.0)
Insert test values for writing tests. Uses default values described below.
All functions take an overrides
parameter that can be used to override the default values.
In order to set your own defaults, you can use the CharonOauth2.Config
field :test_seed_defaults
.
Link to this section Summary
Functions
Inserts an authorization using Elixir.MyApp.CharonOauth2.Authorizations.insert/1
.
Inserts an authorization using Elixir.MyApp.CharonOauth2.Authorizations.insert/1
. Raises on failure.
Inserts a client using Elixir.MyApp.CharonOauth2.Clients.insert/1
.
Inserts a client using Elixir.MyApp.CharonOauth2.Clients.insert/1
. Raises on failure.
Inserts a grant using Elixir.MyApp.CharonOauth2.Grants.insert/1
.
Inserts a grant using Elixir.MyApp.CharonOauth2.Grants.insert/1
. Raises on failure.
Link to this section Functions
@spec insert_test_authorization(keyword() | map()) :: {:ok, MyApp.CharonOauth2.Authorization.t()} | {:error, Ecto.Changeset.t()}
Inserts an authorization using Elixir.MyApp.CharonOauth2.Authorizations.insert/1
.
The default values can be overridden using overrides
. These are the default values:
%{scope: ["read"]}
@spec insert_test_authorization!(keyword() | map()) :: MyApp.CharonOauth2.Authorization.t()
Inserts an authorization using Elixir.MyApp.CharonOauth2.Authorizations.insert/1
. Raises on failure.
The default values can be overridden using overrides
. These are the default values:
%{scope: ["read"]}
@spec insert_test_client(keyword() | map()) :: {:ok, MyApp.CharonOauth2.Client.t()} | {:error, Ecto.Changeset.t()}
Inserts a client using Elixir.MyApp.CharonOauth2.Clients.insert/1
.
The default values can be overridden using overrides
. These are the default values:
%{
description: "Incredibly innovative application that definitely treats your data well.",
grant_types: ["authorization_code"],
name: "MyClient",
redirect_uris: ["https://mysite.tld"],
scope: ["read"]
}
@spec insert_test_client!(keyword() | map()) :: MyApp.CharonOauth2.Client.t()
Inserts a client using Elixir.MyApp.CharonOauth2.Clients.insert/1
. Raises on failure.
The default values can be overridden using overrides
. These are the default values:
%{
description: "Incredibly innovative application that definitely treats your data well.",
grant_types: ["authorization_code"],
name: "MyClient",
redirect_uris: ["https://mysite.tld"],
scope: ["read"]
}
@spec insert_test_grant(keyword() | map()) :: {:ok, MyApp.CharonOauth2.Grant.t()} | {:error, Ecto.Changeset.t()}
Inserts a grant using Elixir.MyApp.CharonOauth2.Grants.insert/1
.
The default values can be overridden using overrides
. These are the default values:
%{redirect_uri: "https://mysite.tld", type: "authorization_code"}
@spec insert_test_grant!(keyword() | map()) :: MyApp.CharonOauth2.Grant.t()
Inserts a grant using Elixir.MyApp.CharonOauth2.Grants.insert/1
. Raises on failure.
The default values can be overridden using overrides
. These are the default values:
%{redirect_uri: "https://mysite.tld", type: "authorization_code"}