Helpers for testing a mountable library.
use PhoenixMountable.Test, host: MyLib.TestHostimports Plug.Conn, Phoenix.ConnTest and Phoenix.LiveViewTest (when
available), sets @endpoint to the host's (see
PhoenixMountable.TestHost), and adds a conn with an empty session to
each test's context.
build_mount/3 builds a mount without a router, to test the library's
options, PhoenixMountable.normalize_options/1 and
PhoenixMountable.session/3.
Summary
Functions
The mount a host would get with my_lib path, opts, validated and
normalized like the mount macro does, but without a router.
Functions
@spec build_mount(module(), String.t(), keyword()) :: PhoenixMountable.Mount.t()
The mount a host would get with my_lib path, opts, validated and
normalized like the mount macro does, but without a router.
mount = PhoenixMountable.Test.build_mount(MyLib.Router, "/my_lib", features: [:beta])
assert mount.options.features == [:beta]