Upcase header logo small 74d881f2938298c588db0b7c93de56caf020a767f5981ad9919f1ab5728e278f

Learn with thoughtbot
Testing b4ad43a80bc6252cf5df2da75ef2818c03ca4364fd1ddd8b17194ab67ce1c9fc

Learn Testing

A method of improving code quality and minimizing time required to add new features to software by ensuring that each facet of the program works as expected.

Trails

Testing

Testing Fundamentals

A method of improving code quality and minimizing time required to add new features to software by ensuring that each facet of the program works as expected.

?

A method of improving code quality and minimizing time required to add new features to software by ensuring that each facet of the program works as expected.

Next Up

Passing Your First Test

In order to get your feet wet with testing, let's write a test for a simple Ruby class.

Unstarted

Testing ActiveRecord

In this exercise, you'll write an RSpec model test to verify a simple validation.

Unstarted

Write an Integration Test

In this example, we'll be using Capybara to write an integration test.

Unstarted

Write a controller spec

In this example, you'll write a unit test to make sure the create action for PeopleController works as expected based on the return value of save.

Unstarted

Write A Feature With Tests

Time to put it all together! In this exercise, you'll add enhance a small Rails applications by adding the ability edit existing people. You'll implement the necessary actions and views in the Rails application, writing tests as you go.

5 steps remaining
Start trail
Testing

Test Doubles

Learn to use stubs, mocks, spies, and fakes with RSpec.

?

Learn to use stubs, mocks, spies, and fakes with RSpec.

Next Up

Simple Stubs

Use rspec-mocks to stub out an object in a test.

Unstarted

Stubs with Constraints

Learn to set constraints on stubbed methods using RSpec.

Unstarted

Setting Expectations with Mocks

Learn to unit test methods with side effects and mutation using mocks.

Unstarted

Verifying Expectations with Spies

Learn how to keep your unit tests tidy with an alternative to mocks: spies.

Unstarted

Testing Flexible Interactions with Fakes

Learn how to test complex or flexible interactions by using fakes.

Unstarted

Verifying Mailers with Test Doubles

Now that you've learned how to use stubs, mocks, spies, and fakes, it's time to pull it all together.

6 steps remaining
Start trail

The Weekly Iteration

Ben Orenstein
Chris Toomey

Weekly Iteration

Route, Controller, Action

Ben Orenstein and Chris Toomey

In this screencast, Ben and Chris go back to basics and tackle the first...

Ben Orenstein
Joe Ferris

Weekly Iteration

Four Phases of Testing

Ben Orenstein and Joe Ferris

This episode covers one method of dividing a test into four distinct phases...

Chris Toomey
Joshua Clayton

Weekly Iteration

Page Objects

Chris Toomey and Joshua Clayton

On this week's episode, Chris is again joined by Josh Clayton,...

Ben Orenstein
Joe Ferris

Weekly Iteration

Integration vs Unit Testing

Ben Orenstein and Joe Ferris

Joe and Ben discuss the reasons for testing, and how integration and unit...

Joe Ferris
Gabe Berke-Williams

Weekly Iteration

Stubs, Mocks, Spies, and Fakes

Joe Ferris and Gabe Berke-Williams

Joe and Gabe review the four types of test doubles: stubs, mocks, spies and...

Chris Toomey
Joe Ferris

Weekly Iteration

Testing Antipatterns

Chris Toomey and Joe Ferris

xUnit Test Patterns The basis for the discussion today comes from the xUnit...

Chris Toomey
Ben Orenstein

Weekly Iteration

Upcase Code Contest

Chris Toomey and Ben Orenstein

Contest Outline This week we're trying out something a little different.

Chris Toomey
Derek Prior

Weekly Iteration

Rspec Bisect

Chris Toomey and Derek Prior

The Problem Sometimes you have a test that fails, but not all the time -- an...

×