ariandanim
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)
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m aware of 2 such projects, are there others?
git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
Hi all,
I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
How do I tell Hologram not to escape HTML when substituting into templates?
{Textile.render(@product.long_description)}
escapes the HTM...
New
Hi,
we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
Hello
I’ve been coding in Elixir for almost two years now because of my current job where we implemented Elixir in our application. But ...
New
Hi all, I’m new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley:
Mutonex gamedesign was finish...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #elixirconf-us
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #security
- #elixirconf-eu
- #api
- #forms
- #hex










Showing Posts 1 to 8- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
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.
zachallaun
When you generate anything with Phoenix, it generates code in
liband tests for that code intest. Naturally, changing the code will cause tests relying on that code to fail. Update your tests or, if you must, delete the failing tests so that at least the remaining ones can be useful.dimitarvp
Tests are written so you’re sure you’re delivering working code. If you’re one of the gods who know their code works without tests then don’t run them.
D4no0
Working code is optional, getting paid is the important part
.
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.
dimitarvp
Even in hobby code at one point you want to make sure the thing works, no? Manual testing does not scale.
LostKobrakai
I mean I don’t disagree, but on the other hand it depends on the context. I’ve for a long time worked on a project, which had (and still has) not much time sensitivity and also not much scale. For quite a bit in the beginning this ran on a system without automated tests (a constraint of the underlying architecture). It wasn’t great, but it also wasn’t too bad. It at least was better than the manual stuff it had replaced. Eventually we switched architecture (to elixir).
So for sure there are many ways where skipping testing can turn on you, but I try to not discredit other paths.
dimitarvp
I didn’t intend to discredit it, sorry if it sounded that way.
And, as I work for a telecom nowadays I get it that not everything can be neatly put into automated tests indeed. Or stuff like Nerves[-like] environments where you actually have to send physical signals – another valid use-case.
So yeah I don’t disagree with you either, it’s just that I’d always default to automated tests if the environment allows for it. If for no any other reason than this one: from one point and on I want to progress and automated tests give you confidence that you at least didn’t break what was working before.