ApiCommons.Helpers.ConnUtils (ApiCommons v0.1.0) View Source

Link to this section Summary

Functions

Creates a Plug.Conn struct for testing purposes. To add additional information to the Plug.Conn struct. Use below "put" functions.

Put body parameter into a Plug.Conn. Only for testing purposes

Put arbitary data in Plug.Conn struct under given key.

Put query params into Plug.Conn. Only for testing purposes

Link to this section Functions

Link to this function

create_conn(method, path)

View Source

Creates a Plug.Conn struct for testing purposes. To add additional information to the Plug.Conn struct. Use below "put" functions.

Parameter:

- method: Atom indicating the method of request.
- path: String representing the request path

Returns: Plug.Conn

Link to this function

put_body_params(conn, value)

View Source

Put body parameter into a Plug.Conn. Only for testing purposes

Link to this function

put_in_conn(conn, key, value)

View Source

Put arbitary data in Plug.Conn struct under given key.

Parmeter:

- conn: Plug.Conn struct
- key: Atom indicating the place where to put the data in
- value: Any value to be put in Plug.Conn

Returns: Plug.Conn

Link to this function

put_lib_data(conn, value)

View Source
Link to this function

put_path_params(conn, value)

View Source
Link to this function

put_query_params(conn, value)

View Source

Put query params into Plug.Conn. Only for testing purposes