Rails 6 API Tutorial - API Tests with RSpec p.9

Опубликовано: 08 Апрель 2026
на канале: Rails Pro
15,623
301

In this video series we will build a Rails API from scratch. Backend APIs are useful for serving data to frontend applications, mobile apps or other backend services.

✨ Check out the new version of this video series, which has been updated for Rails 7    • Rails 7 API Tutorial - Create project and ...  

📖 You can also purchase the eBook and code for the new Rails 7 tutorial - https://tomkadwill.gumroad.com/l/rail...

This video covers:
0:09 - Why automated test is important and useful
0:41 - Using RSpec as a test framework
1:16 - Installing the RSpec gem
2:02 - Running RSpec via the command line
2:13 - Initializing the RSpec directory and test helpers
2:49 - Creating the first API request spec to test for a success status code
5:33 - Updating the test with an assertion for the response body
6:45 - Creating mock test data using FactoryBot

If you’re new to this series, you may want to start with part 1:    • Rails 6 API Tutorial - Create project and ...