Skip to content

Discrepancy in phx.gen.auth templates results in failed test #6681

Description

@strobilomyces

Environment

  • Elixir version (elixir -v): 1.19.5-otp-28
  • Phoenix version (mix deps): 1.8.7
  • Operating system: Linux (Manjaro - 7.0.3-1-MANJARO)

Actual behavior

After running mix phx.gen.auth, there's a mismatch between the generated LiveView templates and the test templates.

In test/myapp_web/live/user_live/login_test.exs, line 12, is the following:

assert html =~ "Register"

which results in:

Assertion with =~ failed

because the live template generated under /lib/myapp_web/live/user_live/login.ex contains:

Sign up instead of Register

Expected behavior

Test templates from phx.gen.auth should match their corresponding LiveView templates.

Solution

Inpriv/templates/phx.gen.auth/login_live_test.exs.eex, line 12:

Change

assert html =~ "Register"

to

assert html =~ "Sign up"

Test passes.

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