Bureaucrat.Macros (bureaucrat v0.2.10)

Implements Phoenix.ConnTest macros with &Bureaucrat.Helpers.doc/1 support. When Phoenix.ConnTest macros (get, post, put...) are called, doc helper is automatically called after. If you don't wish to document a certain request, use get_undocumented or any other _undocumented macro. It automatically skips documentation if halted by a Plug.

When a request is called from inside a private function instead of a test block, Bureaucrat can't find the test name to use on the documentation, and raises. In this case, use the _undocumented version to bypass the documentation, or send the request from the test block instead of private function.

  • Automatically documents: get, post, put, patch and delete requests
  • Skips documentation for: options, connect, trace and head requests
  • Implements: get_undocumented, post_undocumented, put_undocumented, patch_undocumented and delete_undocumented.

usage

Usage

On ConnCase file, change this

import Phoenix.ConnTest

To

import Phoenix.ConnTest, only: :functions
import Bureaucrat.Helpers
import Bureaucrat.Macros

Link to this section Summary

Functions

Dispatches test request without documentation. Skips documentation for: options, connect, trace and head requests

Dispatches test request with documentation. Documents: get, post, put, patch and delete requests.

Dispatches test request without documentation. Implements: get_undocumented, post_undocumented, put_undocumented, ..., macros to skip doc.

Dispatches test request with documentation. Documents: get, post, put, patch and delete requests.

Dispatches test request without documentation. Implements: get_undocumented, post_undocumented, put_undocumented, ..., macros to skip doc.

Dispatches test request without documentation. Skips documentation for: options, connect, trace and head requests

Dispatches test request without documentation. Skips documentation for: options, connect, trace and head requests

Dispatches test request with documentation. Documents: get, post, put, patch and delete requests.

Dispatches test request without documentation. Implements: get_undocumented, post_undocumented, put_undocumented, ..., macros to skip doc.

Dispatches test request with documentation. Documents: get, post, put, patch and delete requests.

Dispatches test request without documentation. Implements: get_undocumented, post_undocumented, put_undocumented, ..., macros to skip doc.

Dispatches test request with documentation. Documents: get, post, put, patch and delete requests.

Dispatches test request without documentation. Implements: get_undocumented, post_undocumented, put_undocumented, ..., macros to skip doc.

Dispatches test request without documentation. Skips documentation for: options, connect, trace and head requests

Link to this section Functions

Link to this macro

connect(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request without documentation. Skips documentation for: options, connect, trace and head requests

Link to this macro

delete(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request with documentation. Documents: get, post, put, patch and delete requests.

Link to this macro

delete_undocumented(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request without documentation. Implements: get_undocumented, post_undocumented, put_undocumented, ..., macros to skip doc.

Link to this macro

get(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request with documentation. Documents: get, post, put, patch and delete requests.

Link to this macro

get_undocumented(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request without documentation. Implements: get_undocumented, post_undocumented, put_undocumented, ..., macros to skip doc.

Link to this macro

head(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request without documentation. Skips documentation for: options, connect, trace and head requests

Link to this macro

options(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request without documentation. Skips documentation for: options, connect, trace and head requests

Link to this macro

patch(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request with documentation. Documents: get, post, put, patch and delete requests.

Link to this macro

patch_undocumented(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request without documentation. Implements: get_undocumented, post_undocumented, put_undocumented, ..., macros to skip doc.

Link to this macro

post(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request with documentation. Documents: get, post, put, patch and delete requests.

Link to this macro

post_undocumented(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request without documentation. Implements: get_undocumented, post_undocumented, put_undocumented, ..., macros to skip doc.

Link to this macro

put(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request with documentation. Documents: get, post, put, patch and delete requests.

Link to this macro

put_undocumented(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request without documentation. Implements: get_undocumented, post_undocumented, put_undocumented, ..., macros to skip doc.

Link to this macro

trace(conn, path_or_action, params_or_body \\ nil)

(macro)

Dispatches test request without documentation. Skips documentation for: options, connect, trace and head requests