-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset password - test fails issue #679
Comments
Update: I think I made big step with this case. I digged into issues here and I found something that looks promising to me. After all it still shows an error but I think it's pretty easy to pass, but still I didnt found solution. I added to test folder Ets Cache Mock:
Updated test config with:
Error is the same if I change it to:
I updated conn_case.ex with:
Adding this line to test_helper.exs leads to fail all tests - even with registration/session controllers:
I also updated password_controller_test.exs:
Trying to start test leads to error:
I also changed :set to :ordered_set but nothing changes with error. Maybe in Pow 1.0.27 there are changes that I didnt implemented or I wrote something incorrectly. I'll check later PowApiTemplate.Test.EtsCacheMock.init() function and I will try to play with options. |
Hi I really appreciate your work on Pow Auth. It is really great and compact. For learning purposes I try to create my custom controllers for the most important cases. Just to know how it works under the hood, to test it easily in Postman (putting tokens in json and pasting them in another bodies) and how to write good tests in Elixir.
I've struggling for many hours with testing reset password controller, it raises errors every time and that forced me to write an issue cause my digging through web leads to nowhere :)
I start from beginning. Here is my forgot_password func. Pretty straight forward except token in json - easy to test with postman.
And here is my reset_password controller:
Everything works fine during testing in Postman - I dont know yet how to use session/cache token in this application so I use what I learnt while learning C# with JWT tokes.
I put my forgot_password and reset_password tests in one file (the same like they both are in one controller file) Here is my forgot_password part:
It works well. Simple, compact, 5 minutes of work. Then problems started to appear - I've tried many configurations of reset password tests but nothing seems to work.
1st attemp:
Witth error:
I suppose it needs real token. So pretty simple that It crashed.
2nd attemp:
At first I thought it has to be working. Token is invoked and I didnt use any variables to omit mistakes. Then I got error:
(Pow.Config.ConfigError) Pow configuration not found in connection. Please use a Pow plug that puts the Pow configuration in the plug connection.
I have no idea what to do now. I spent many hours on elixir forum, with documentation and on github trying to find people with similar problem or repos with custom controllers but it leads to nowhere. I have in my head another solutions, but I know too little yet to do it all by myself without any tips. I dont want to go further without understanding this part and I want to have my own boilerplate for my projects.
I have also some questions:
Greetings and thanks for your help :)
The text was updated successfully, but these errors were encountered: