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.

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

Learning objectives

  • 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:

  1. An introduction to test-driven development in general:
    • What it is
    • Why it works
    • And when to use it
  2. RSpec to create tests for a new Rails application
  3. Rails-specific features
  4. Test Rails functionality
Create tests for a new Rails application
  1. What makes testing and tests valuable
  2. Basic unit tests, models, multiple ways of generating data for tests, and using test doubles to simulate objects and specify hard-to-reach states
  3. End-to-end tests
  4. An extension to end-to-end tests for code that has JavaScript, and then about unit-testing JavaScript by itself
  1. Rails that we haven’t covered or seen the tool support for in those systems

  2. Minitest usage instead of RSpec

  3. Specific scenarios for testing, including testing for security and testing third-party services

  4. Troubleshooting failing tests, how to improve the test environment, and how to run the tests quickly

  5. Where we need to add tests to untested legacy code

How to improve the test environment and run the tests quickly

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:

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.

You should already be comfortable with Ruby on Rails