Bureaucrat.Helpers (bureaucrat v0.2.10)

Link to this section Summary

Functions

Adds a conn to the generated documentation.

Adds a conn to the generated documentation

Adds a Phoenix.Socket connection to the generated documentation.

Adds a Phoenix.Socket.Message to the generated documentation.

Helper function for adding the phoenix_controller and phoenix_action keys to the private map of the request that's coming from the test modules.

Link to this section Functions

Link to this function

default_description()

Link to this macro

doc(conn)

(macro)

Adds a conn to the generated documentation.

The name of the test currently being executed will be used as a description for the example.

Link to this macro

doc(conn, desc)

(macro)

Adds a conn to the generated documentation

The description, and additional options can be passed in the second argument:

examples

Examples

conn = conn()
  |> get("/api/v1/products")
  |> doc("List all products")

conn = conn()
  |> get("/api/v1/products")
  |> doc(description: "List all products", operation_id: "list_products")
Link to this macro

doc_broadcast_from!(socket, event, message)

(macro)
Link to this macro

doc_broadcast_from(socket, event, message)

(macro)
Link to this macro

doc_connect(handler, params, connect_info \\ quote do %{} end)

(macro)

Adds a Phoenix.Socket connection to the generated documentation.

The name of the test currently being executed will be used as a description for the example.

Link to this macro

doc_push(socket, event)

(macro)

Adds a Phoenix.Socket.Message to the generated documentation.

The name of the test currently being executed will be used as a description for the example.

Link to this macro

doc_push(socket, event, payload)

(macro)
Link to this function

format_test_name(arg1)

Link to this function

get_default_operation_id(arg1)

Link to this function

group_title_for(mod, list)

Link to this function

plug_doc(conn, list)

Helper function for adding the phoenix_controller and phoenix_action keys to the private map of the request that's coming from the test modules.

For example:

test "all items - unauthenticated", %{conn: conn} do conn |> get(itempath(conn, :index)) |> plugdoc(module: __MODULE, action: :index) |> doc() |> assert_unauthenticated() end

The request from this test will never touch the controller that's being tested, because it is being piped through a plug that authenticates the user and redirects to another page. In this scenario, we use the plug_doc function.