Downloads
-
Introduction
-
Fundamentals: Intro to Testing Principles
- Overview
- How to make testing a habit
- What level of test coverage to shoot for
- Test-driven development (TDD) vs. testing without TDD
-
Fundamentals: Rails Testing Tools
- Overview
- RSpec vs. Minitest: which framework to learn
- Rails testing tools and how to use them
- The different kinds of RSpec tests and when to use each
- Adding tests to an existing project vs. starting fresh
-
Fundamentals: Your First Practice Tests
- Overview
- Setting up a new Rails project for testing
- A Rails testing “hello world” using RSpec and Capybara
-
Factory Bot: Introduction
-
Factory Bot: Getting Started
- Installing Factory Bot
- Factory definitions
- Where to put factory definitions
- Factory Bot hello world
- Configuring Factory Bot with RSpec
-
Factory Bot: Build Strategies and Faker
-
Factory Bot: Advanced Usage
- Introduction
- Nested factories
- Traits
- When to use traits versus nested factories
- Callbacks
- Transient attributes
-
RSpec Syntax: Introduction
-
RSpec Syntax: The Structure of a Test
-
RSpec Syntax: Understanding Blocks
- RSpec Syntax: Understanding Blocks
- Writing our own block
- Why this example is meaningful
- Implementing the example
- Coming back to the controller example
-
RSpec Syntax: Let, Let! and Instance Variables
- The purpose of let and the differences between let and instance variables
- How let works and the difference between let and let!
- Takeaways
-
RSpec Syntax: The Parts of an RSpec Test
- What we're going to do in this chapter
- The example code
- Specs, examples, "example groups" and "it blocks"
- The expect keyword
- What's next
-
RSpec Syntax: Build Your Own RSpec, Part 1
-
RSpec Syntax: Build Your Own RSpec, Part 2
-
RSpec Syntax: Describe and Context
-
System Specs: Introduction
- What this section will cover
- What system specs are
- When to write system specs
- The tools that support system specs
- Why I recommend against using Cucumber
- The difference between system specs and feature specs
-
System Specs: Getting Started
- Installing Capybara and related tools
- RSpec + Capybara "hello world" revisited
- Logging the user in before tests
- Headless vs. not headless
-
System Specs: Writing Specs for CRUD Features
- System Specs: Writing Specs for CRUD Features
- The three integration test cases I write for any Rails CRUD feature
- Creating a record with valid inputs
- Trying to create a record with invalid inputs
- Updating a record
-
System Specs: Tutorial
-
System Specs: Capybara's Domain-Specific Language (DSL)
-
System Specs: Simplifying Test Code with Page Objects
- The challenge of keeping test code clean
- What a Page Object is and when it's helpful
- A Page Object example
- The obscure test
-
Model Specs: Introduction
- The purpose of model specs
- Meaningful model specs vs. pointless model specs
- Why I don't recommend Shoulda matchers
-
Model Specs: Tutorial, Part One
-
Model Specs: Tutorial, Part Two
-
Request Specs
-
Mocks and Stubs
- Mocks and Stubs
- The problem with testing terminology
- Test doubles
- Stub explanation
- Mock explanation
- The difference between mocks and stubs
- Example application code
- Stub example
- Mock example
- Why I don't often use mocks or stubs in Rails
- What's next
-
VCR and WebMock
How to use this book
Updated: