RestAuth v1.1.1 RestAuth.Test View Source

Utilities for testing endpoints using RestAuth.

Link to this section Summary

Functions

Authenticates connection to bypass the regular header/cookie workflow

Allows configuring the test connection

Link to this section Functions

Link to this function authenticate_conn(conn, user) View Source

Authenticates connection to bypass the regular header/cookie workflow

Useful for tests.

Allows configuring the test connection.

Equivalent to calling the RestAuth.Configure plug.

Example

# in conn_case.ex

setup do
  conn = Phoenix.ConnTest.build_conn()
  {:ok, RestAuth.Test.configure(conn, handler: MyApp.Handler)}
end