Who Should Take this Course and Why?
Get an overview of what we'll learn in this course and what we need to get started.
We'll cover the following
Learning objectives
Throughout the course we’ll learn about the following:
-
How to apply a test-driven development (TDD) process to the creation of applications that use Ruby-on-Rails
-
How to apply TDD to our everyday coding
-
How to apply the tools and libraries that make testing in Rails easier
-
What tools are available and when those tools are best used
-
How to use the tools available for writing tests
-
How to apply a test-driven process and automated testing to build a Rails application
We hope that you come away from this course committed to the idea of writing better code through the small steps of a test-driven development process.
What’s in this course
In the course, we’ll go through the following one-by-one:
- An introduction to test-driven development in general:
- What it is
- Why it works
- And when to use it
- RSpec to create tests for a new Rails application
- Rails-specific features
- Test Rails functionality
- What makes testing and tests valuable
- Basic unit tests, models, multiple ways of generating data for tests, and using test doubles to simulate objects and specify hard-to-reach states
- End-to-end tests
- An extension to end-to-end tests for code that has JavaScript, and then about unit-testing JavaScript by itself
-
Rails that we haven’t covered or seen the tool support for in those systems
-
Minitest usage instead of RSpec
-
Specific scenarios for testing, including testing for security and testing third-party services
-
Troubleshooting failing tests, how to improve the test environment, and how to run the tests quickly
-
Where we need to add tests to untested legacy code
Prerequisites
This course assumes prior experience with Ruby and familiarity with the development of a Rails application. It does not assume any particular familiarity with testing frameworks or testing tools used within Rails.
What we need
The sample code and mini application we build in this course use the following:
- Ruby: 2.7.2
- Rails: 6.0.3.4
- SQLite Database
The installation of these tools is beyond the scope of the course, and it isn’t required either. However, we can find instructions to install them at their footnoted websites.