ariandanim

ariandanim

Not using Mix test

Does it okay if I never use mix test?

I am currently developing app but never try to use mix test, because some of code I made custom in lib folder, sometime when i try make account like mix phx.gen.auth Accounts User users, i try to made custom in the code. but when try make mix test some failure comes in like below :

  1) test confirm email does not update email with invalid token (TrainWeb.UserSettingsLiveTest)
     test/train_web/live/user_settings_live_test.exs:192
     match (=) failed
     code:  assert {:live_redirect, %{to: path, flash: flash}} = redirect
     left:  {:live_redirect, %{flash: flash, to: path}}
     right: {
              :redirect,
              %{
                flash: %{"error" => "You must activated via link activation that send it into your mail to access this page."},
                to: "/users/log_in"
              }
            }
     stacktrace:
       test/train_web/live/user_settings_live_test.exs:194: (test)



  2) test update email form renders errors with invalid data (phx-submit) (TrainWeb.UserSettingsLiveTest)
     test/train_web/live/user_settings_live_test.exs:68
     ** (MatchError) no match of right hand side value: {:error, {:redirect, %{to: "/users/log_in", flash: %{"error" => "You must activated via link activation that send it into your mail to access this page."}}}}
     code: {:ok, lv, _html} = live(conn, ~p"/users/settings")
     stacktrace:
       test/train_web/live/user_settings_live_test.exs:69: (test)



  3) test Settings page renders settings page (TrainWeb.UserSettingsLiveTest)
     test/train_web/live/user_settings_live_test.exs:9
     ** (MatchError) no match of right hand side value: {:error, {:redirect, %{to: "/users/log_in", flash: %{"error" => "You must activated via link activation that send it into your mail to access this page."}}}}
     code: {:ok, _lv, html} =
     stacktrace:
       test/train_web/live/user_settings_live_test.exs:10: (test)

.

  4) test update email form updates the user email (TrainWeb.UserSettingsLiveTest)
     test/train_web/live/user_settings_live_test.exs:35
     ** (MatchError) no match of right hand side value: {:error, {:redirect, %{to: "/users/log_in", flash: %{"error" => "You must activated via link activation that send it into your mail to access this page."}}}}
     code: {:ok, lv, _html} = live(conn, ~p"/users/settings")
     stacktrace:
       test/train_web/live/user_settings_live_test.exs:38: (test)

.

  5) test update email form renders errors with invalid data (phx-change) (TrainWeb.UserSettingsLiveTest)
     test/train_web/live/user_settings_live_test.exs:52
     ** (MatchError) no match of right hand side value: {:error, {:redirect, %{to: "/users/log_in", flash: %{"error" => "You must activated via link activation that send it into your mail to access this page."}}}}
     code: {:ok, lv, _html} = live(conn, ~p"/users/settings")
     stacktrace:
       test/train_web/live/user_settings_live_test.exs:53: (test)

...

  6) test update password form renders errors with invalid data (phx-change) (TrainWeb.UserSettingsLiveTest)
     test/train_web/live/user_settings_live_test.exs:121
     ** (MatchError) no match of right hand side value: {:error, {:redirect, %{to: "/users/log_in", flash: %{"error" => "You must activated via link activation that send it into your mail to access this page."}}}}
     code: {:ok, lv, _html} = live(conn, ~p"/users/settings")
     stacktrace:
       test/train_web/live/user_settings_live_test.exs:122: (test)

.

  7) test confirm email updates the user email once (TrainWeb.UserSettingsLiveTest)
     test/train_web/live/user_settings_live_test.exs:174
     match (=) failed
     code:  assert {:live_redirect, %{to: path, flash: flash}} = redirect
     left:  {:live_redirect, %{flash: flash, to: path}}
     right: {
              :redirect,
              %{
                flash: %{"error" => "You must activated via link activation that send it into your mail to access this page."},
                to: "/users/log_in"
              }
            }
     stacktrace:
       test/train_web/live/user_settings_live_test.exs:177: (test)

...

  8) test update password form renders errors with invalid data (phx-submit) (TrainWeb.UserSettingsLiveTest)
     test/train_web/live/user_settings_live_test.exs:140
     ** (MatchError) no match of right hand side value: {:error, {:redirect, %{to: "/users/log_in", flash: %{"error" => "You must activated via link activation that send it into your mail to access this page."}}}}
     code: {:ok, lv, _html} = live(conn, ~p"/users/settings")
     stacktrace:
       test/train_web/live/user_settings_live_test.exs:141: (test)

.

  9) test update password form updates the user password (TrainWeb.UserSettingsLiveTest)
     test/train_web/live/user_settings_live_test.exs:92
     ** (MatchError) no match of right hand side value: {:error, {:redirect, %{to: "/users/log_in", flash: %{"error" => "You must activated via link activation that send it into your mail to access this page."}}}}
     code: {:ok, lv, _html} = live(conn, ~p"/users/settings")
     stacktrace:
       test/train_web/live/user_settings_live_test.exs:95: (test)

Most Liked Responses

LostKobrakai

LostKobrakai

Don’t forget that not everyone is coding for professional reasons. Also automated tests are not the only form of testing. So even with automated tests being a useful tool they’re by no means generally required.

To answer the question though: Yes phoenix cannot automatically adjust tests to take authentication into account, given it has no idea about what content should require authentication or not. Therefore adjusting the automatically generated tests for those additional concerns is required.

emadb

emadb

Maybe, I don’t understand what are you asking.

If you don’t want to write test, you can avoid to run mix test.
The failing tests that you are showing have a pretty clear error message and should be easy to fix them in you want.

Try to explain better your problem. Thank you.

D4no0

D4no0

Working code is optional, getting paid is the important part :joy: .

Where Next?

Popular in Questions Top

greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
earth10
Hi, I’m just starting to build a side-project with Elixir and Phoenix and doing some basic test with Elixir alone. What strikes me is th...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> somethi...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New

Other popular topics Top

marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement