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.
In order to get your feet wet with testing, let's write a test for a simple Ruby class.
In this exercise, you'll write an RSpec model test to verify a simple validation.
In this example, we'll be using Capybara to write an integration test.
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.
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.
Learn to use stubs, mocks, spies, and fakes with RSpec.
Use rspec-mocks to stub out an object in a test.
Learn to set constraints on stubbed methods using RSpec.
Learn to unit test methods with side effects and mutation using mocks.
Learn how to keep your unit tests tidy with an alternative to mocks: spies.
Learn how to test complex or flexible interactions by using fakes.
Now that you've learned how to use stubs, mocks, spies, and fakes, it's time to pull it all together.
Joe and Ben discuss the reasons for testing, and how integration and unit...
This episode covers one method of dividing a test into four distinct phases...
On this week's episode, Chris is again joined by Josh Clayton,...
Joe and Gabe review the four types of test doubles: stubs, mocks, spies and...
In this screencast, Ben and Chris go back to basics and tackle the first...