filmov
tv
Writing a request spec / test in Rails with authentication
Показать описание
What good is it to have an application if you don't know if it works? By writing automated tests around the most useful/important pieces of your application, you can build with confidence. And if you need to make a change to your code, you can know immediately if it still works.
Using Rspec, I build out an automated request spec to make requests against multiple API endpoints. Each endpoint has a different purpose, and I show how to write tests for both authenticated and unauthenticated users.
🤯 Contribute on Patreon
⏱️ Timestamps:
00:00 - Introduction
00:31 - End result
00:45 - Installing rspec rails
04:19 - spec support - object creators
06:30 - devise specific controllers
09:45 - other files
💌 Newsletter:
🪐Elsewhere:
💭Concepts:
* Rspec
* Request Spec
* Devise
* Authorization
* authenticate_user!
📚Resources:
🎬 Subscribe!
My name is David W Parker and I’m creating and publishing videos on ProgrammingTIL to help teach anyone and everyone who wants to code. I’m a huge fan of Ruby on Rails, Svelte, and WebGL. I’ve used React a lot in the past, as well as some Vue and AngularJS. I’ve done some professional Python and Django as well. I like to create real applications and my tutorials will walk you through how to build something real from beginning-to-end.
#ruby #rails #rubyonrails
Using Rspec, I build out an automated request spec to make requests against multiple API endpoints. Each endpoint has a different purpose, and I show how to write tests for both authenticated and unauthenticated users.
🤯 Contribute on Patreon
⏱️ Timestamps:
00:00 - Introduction
00:31 - End result
00:45 - Installing rspec rails
04:19 - spec support - object creators
06:30 - devise specific controllers
09:45 - other files
💌 Newsletter:
🪐Elsewhere:
💭Concepts:
* Rspec
* Request Spec
* Devise
* Authorization
* authenticate_user!
📚Resources:
🎬 Subscribe!
My name is David W Parker and I’m creating and publishing videos on ProgrammingTIL to help teach anyone and everyone who wants to code. I’m a huge fan of Ruby on Rails, Svelte, and WebGL. I’ve used React a lot in the past, as well as some Vue and AngularJS. I’ve done some professional Python and Django as well. I like to create real applications and my tutorials will walk you through how to build something real from beginning-to-end.
#ruby #rails #rubyonrails
Комментарии