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
default_description()
Adds a conn to the generated documentation.
The name of the test currently being executed will be used as a description for the example.
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")
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.
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.
format_test_name(arg1)
get_default_operation_id(arg1)
group_title_for(mod, list)
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.