Uploaded November 2022 | Updated November 2026, 3 hours ago
Now that we've taken care of fixing Devise so that it works with Turbo and Tailwind, we can get to work writing tests to validate that our vital user authentication flows are working as intended.
We start by manually executing and demonstrating the flow we intend to automate. Then we generate our test class and implement the system test.
We test the "happy path" of sign up working correctly for the user as well as error scenarios like a user with a bad email address or a password that's too short.
After we get all of the positive and negative scenarios working as intended, we refactor our code to move any repeated assertions or other code into smaller methods that can be invoked from multiple different methods.
This video covers:
00:00:12 Introduction
00:03:37 Demonstration of the functionality to be tested
00:06:15 Generate the test case and move it to match what we want for a name.
00:11:08 Happy path test for user sign up
00:22:09 Demonstration of a purposely failed test and ability to use debugger to inspect current state of test
00:26:04 Figure out error scenarios
00:28:18 Invalid email format test and troubleshooting how to test the built-in HTML form validation
00:34:44 Skip the email format one for now and implement scenarios for email already taken, password too short and password confirmation mismatch
00:45:27 Invalid confirmation token test
00:49:06 Fix for HTML5 error message by using query selector and inspecting validity of form.
00:54:09 Run RuboCop and auto-correct errors
00:55:12 Refactor repeated code into smaller re-usable methods
01:28:44 Commit and push code, update project
#ruby #rails7 #rails #rubyonrails #rubygems #codecast #screencast #github #opensource #minitest #TDD #agile #NerdDice #DnD #roleplaying #softwaredevelopment #learntocode #tailwind #postgresql #rubocop #devise #turbo #controllers #views #selenium #capybara #systemtest
See other related StatelessCode videos:
- Overview of Authentication Epic and Choosing Devise youtu.be/FbBDmiqRFzI
Resources that we relied upon for this solution:
- Testing HTML5 Messages with RSpec/Selenium medium.com/@tmikeschu/testing-html5-messages-with-rspec-selenium-5f5834c5af10
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.
Now that we've taken care of fixing Devise so that it works with Turbo and Tailwind, we can get to work writing tests to validate that our vital user authentication flows are working as intended.
We start by manually executing and demonstrating the flow we intend to automate. Then we generate our test class and implement the system test.
We test the "happy path" of sign up working correctly for the user as well as error scenarios like a user with a bad email address or a password that's too short.
After we get all of the positive and negative scenarios working as intended, we refactor our code to move any repeated assertions or other code into smaller methods that can be invoked from multiple different methods.
This video covers:
00:00:12 Introduction
00:03:37 Demonstration of the functionality to be tested
00:06:15 Generate the test case and move it to match what we want for a name.
00:11:08 Happy path test for user sign up
00:22:09 Demonstration of a purposely failed test and ability to use debugger to inspect current state of test
00:26:04 Figure out error scenarios
00:28:18 Invalid email format test and troubleshooting how to test the built-in HTML form validation
00:34:44 Skip the email format one for now and implement scenarios for email already taken, password too short and password confirmation mismatch
00:45:27 Invalid confirmation token test
00:49:06 Fix for HTML5 error message by using query selector and inspecting validity of form.
00:54:09 Run RuboCop and auto-correct errors
00:55:12 Refactor repeated code into smaller re-usable methods
01:28:44 Commit and push code, update project
#ruby #rails7 #rails #rubyonrails #rubygems #codecast #screencast #github #opensource #minitest #TDD #agile #NerdDice #DnD #roleplaying #softwaredevelopment #learntocode #tailwind #postgresql #rubocop #devise #turbo #controllers #views #selenium #capybara #systemtest
See other related StatelessCode videos:
- Overview of Authentication Epic and Choosing Devise youtu.be/FbBDmiqRFzI
Resources that we relied upon for this solution:
- Testing HTML5 Messages with RSpec/Selenium medium.com/@tmikeschu/testing-html5-messages-with-rspec-selenium-5f5834c5af10
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.










