This is the 19th video in the Getting Started with Rails 7 series. In this video Mike starts the section on basic authentication and gets it working. Then he tries and does not (yet) succeed in getting the browser tests working with basic auth.
This video covers:
00:00:10 Introduction and review
00:05:07 Adapt ArticlesControllerTest for authenticated and unauthenticated user scenarios
00:13:20 Implement basic auth in ArticlesController
00:15:15 Validate behavior in UI
00:16:17 Fix failures in ArticlesControllerTest due to incorrect hash structure on update action
00:18:29 Adapt CommentsdControllerTest for authenticated and unauthenticated user scenarios and add auth to CommentsController
00:20:38 Try to get browser tests to work with Basic Authentication
00:45:36 To be continued...
Notes:
As pointed out by Rails From Zero ( / @danielmirceadev ) in the comments below, adding the debugger command to the in the test would have allowed us to pause the code and examine the current state (both in IRB and in the JavaScript console). This would have made debugging more efficient.
Trying to get the browser tests to work with Basic Auth was not a smooth process. We leave the mistakes and troubleshooting in the videos on purpose because you can still learn from when things don't go well. See Why Leave Mistakes in the Videos • Why Leave Mistakes in the Videos? for more.
This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.
Смотрите видео Codecast: Getting Started with Rails 7 19: Basic Auth Part 1 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Stateless Code 12 Январь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 82 раз и оно понравилось 5 людям.