Programming Phoenix LiveView (Section 10 - Unit Test Test Survey Results State)


In the same chapter, we should remove :registe_and_log_in_user and update the code as below. Otherwise, setup will call PentoWeb.ConnCase.register_and_log_in_user/1 which will call Pento.AccountsFixtures.user_fixture/1. And the user “test” will be replaced with the user from Pento.AccountsFixtures.user_fixture/1.

  describe "Socket state" do
    setup [
      :create_user,
      :create_product,
      :create_socket
    ]