The blog post for this tutorial is available at https://deanin.com/blog/rspec-rails
Rails 6 RSpec is one of the topics that I've been asked to cover a few times on the YouTube channel. So what exactly is RSpec, and what does it have to do with Ruby on Rails? Well, RSpec is a behavior-driven development (BDD) testing framework.
Behavior-driven development, as far as how I like to define it, is test-driven development (TDD) where the behavior of the feature is the focus. Instead of saying, "This unit test is for this functionality," a BDD approach might be to say, "this unit test is for this business value."
So back to RSpec, how does it help you? What is RSpec's value proposition to you, the user? Well, RSpec allows you to quickly create Ruby specs, hence the name, for testing various logic in your application. As you continue reading, you'll see some, but not all, of the testing capabilities of using Rails 6 RSpec. We'll start by creating an app and adding a basic scaffold and Devise users. Then we'll set about testing some of the functionality.
If you're interested in learning more about testing in Ruby on Rails, I highly recommend the book "Rails 5 Test Prescriptions" by Noel Rappin. You can check it out here via my affiliate link on Amazon: https://amzn.to/2VQ9j91
Timestamps
0:00 Intro and Project Overview
3:15 Code Starts - Creating The Sample App
16:45 Using Rails 6 RSpec To Test The Application
17:45 Testing The Models
30:17 Testing The Views
36:45 Testing The Controller Actions
46:00 Testing Helper Methods With RSpec
51:41 Video Outro and Project Summary
Photo by Daria Nepriakhina on Unsplash
Follow me on social media:
https://linktr.ee/deanin
Join this channel to get access to perks:
https://www.youtube.com/channel/UCRQv...
If you liked this video, please consider subscribing: https://t.co/RZ4EwP0F2a
#Deanin #Rails6 #20in20