Skip to content

Feature suggestion: Improved test helper for building a conn for unit test's #3640

Description

@JonRowe

As per the docs you currently need to chain several calls together to build a conn for unit testing controller helpers or plugs, e.g.:

conn = build_conn() |> bypass_through(AppWeb.Router, [:pipeline]) |> get("/")

For me this was not named particularly well, why am I running a conn through a bypass to get a pipeline run? And why do I have to call get?

What I would like, (and if you're ok with it I'm happy to produce a pr)

build_conn_for_pipeline(AppWeb.Router, [:pipeline])

I feel this name would be much clearer in the docs as to what it does, and could even be built out of the existing components, and would prevent people face palming like I did!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions