riverrun / phauxth_installer

No longer maintained - Installer for the Phauxth authentication library
13 stars 4 forks source link

Tests always fail. #18

Open 4e554c4c opened 4 years ago

4e554c4c commented 4 years ago

BUG

Tests do not run on a default install. This seems to be due to the fact that they are checking that structs returned from list_users() are the same as structs stored in the tests. However, since the users created by the installer only have a virtual password field it is not returned and fails the tests.

Reproducing

  1. create phoenix project
    $ mix phx.new test && cd test
  2. Install phauxth
    $ mix phaux.new
  3. Run tests
    $ mix test

    example output

    1) test read user data get_user! returns the user with given id (Test.AccountsTest)
     test/test/accounts/accounts_test.exs:22
     Assertion with == failed
     code:  assert Accounts.get_user!(user.id) == user
     left:  %Test.Accounts.User{
              __meta__: #Ecto.Schema.Metadata<:loaded, "users">,
              email: "fred@example.com",
              id: 22,
              inserted_at: ~N[2020-06-02 05:29:42],
              password: nil,
              password_hash: "$argon2id$v=19$m=256,t=1,p=4$x0befv6wH/3R1NvKMgOJCg$1WW58SCLQHDXStef7yvAlSEGtc1xk3/lzOH+3Cq2Mh4",
              sessions: #Ecto.Association.NotLoaded<association :sessions is not loaded>,
              updated_at: ~N[2020-06-02 05:29:42]
            }
     right: %Test.Accounts.User{
              __meta__: #Ecto.Schema.Metadata<:loaded, "users">,
              email: "fred@example.com",
              id: 22,
              inserted_at: ~N[2020-06-02 05:29:42],
              password: "reallyHard2gue$$",
              password_hash: "$argon2id$v=19$m=256,t=1,p=4$x0befv6wH/3R1NvKMgOJCg$1WW58SCLQHDXStef7yvAlSEGtc1xk3/lzOH+3Cq2Mh4",
              sessions: #Ecto.Association.NotLoaded<association :sessions is not loaded>,
              updated_at: ~N[2020-06-02 05:29:42]
            }
     stacktrace:
       test/test/accounts/accounts_test.exs:24: (test)
riverrun commented 4 years ago

Thanks for letting me know about this issue. I will look into it in the next few days.

riverrun commented 2 years ago

First, sorry for the delay in responding to this issue.

Second, this repository is no longer actively maintained. I just do not have the time or energy needed to continue maintaining it.