Introduction to Testing
Explore how to implement testing in Ruby on Rails by understanding the test folder structure. Learn to run all or specific tests and interpret results to ensure your application meets requirements.
We'll cover the following...
We'll cover the following...
What is testing?
Testing is a process used to ensure that your application runs according to your requirements. For your web application, testing can include things such as checking for invalid redirects, validations on your form fields, data integrity, etc.
Rails test structure
Whenever you create a new project using rails new, a test folder is automatically created for you. The structure of the folder is illustrated below:
| File/ Folder | Purpose |
|---|---|
controllers/ |
holds tests for controllers, routes, |