Articles

Most Popular Articles

A Rails testing “hello world” using RSpec and Capybara
If you’ve never written a test in Rails before, this guide will make it easy to write your first one. Includes video.

A repeatable, step-by-step process for writing Rails integration tests with Capybara
Perhaps the hardest part of writing a test is just figuring out how to get started. This guide provides an easy step-by-step process to follow so that you never get stuck before you start.

RSpec/Capybara integration tests: the ultimate guide
If you’ve written a few RSpec/Capybara integration tests but you want to understand integration tests more deeply, this guide will help. This guide will also help if you’re confused about testing terminology.

Technical Articles

Ruby/Rails Testing

Ruby Testing Micro-Course
How to get started with Rails testing
A Rails testing “hello world” using RSpec and Capybara
A Rails model test “hello world”
My general approach to Rails testing
RSpec/Capybara integration tests: the ultimate guide
A repeatable, step-by-step process for writing Rails integration tests with Capybara
How to write a test when the test implementation isn’t obvious
How to deal with complex Factory Bot associations in RSpec tests
Examples of pointless types of RSpec tests
Ruby/Rails testing glossary
Rails testing resource roundup
Factories and fixtures in Rails
How I write characterization tests
Refactoring to POROs (using tests)
How to clear up obscure Rails tests using Page Objects
Test smell: Obscure Test
Code smell: long, procedural background jobs (and how to fix it)
Testing private methods
How I test JavaScript-heavy Rails applications
RSpec mocks and stubs in plain English
How to test methods that involve puts or gets
Mystified by RSpec’s DSL? Some parentheses can add clarity
Sometimes it’s better for tests to hit the real API
Common causes of flickering/flapping/flaky tests
How dependency injection can make Rails tests easier
How to pick a testing framework for your Rails project
Things you can (and should) ignore when getting started with Rails testing
Taming legacy Ruby code using the “Sprout Method” technique, example 1
Taming legacy Ruby code using the “Sprout Method” technique, example 2
When I use controller/request specs in Rails and when I don’t
The difference between integration tests and controller tests in Rails
The difference between RSpec, Capybara and Cucumber
How to get RSpec to skip view specs when you generate scaffolds
RSpec hello world
Testing anti-pattern: setup data leak
Achieving blur in capybara
Capybara: expect field to have value
Logging the user in before Capybara feature specs
Why I recommend against using Cucumber
How to see your feature specs run in the browser
How to run feature specs headlessly or not headlessly at will
Avoiding network calls in Rails tests without using mocks, stubs or VCR
Rails scaffolding and TDD are incompatible
In which I dissect and improve a Rails test file I found on Reddit
Reader Q&A: Tommy’s question about testing legacy code

General testing

Using tests as a tool to wrangle legacy projects
How I make testing a habit
The five benefits of automated testing
What if I want to do test-first but I find it easier to do test-after?
Deploy to production on day one
What a “walking skeleton” is and why I always start projects with one
What exactly makes “bad” code bad?
Why “users don’t care about code” is a harmful saying
“We don’t have time to write tests”
Atomic commits and testing
All code eventually gets tested, it’s just a question of when and by whom
Continuous integration
How do you tell which areas of a project’s test suite need attention?

Ruby/Rails

Where to put Rails modules
For organizing Rails projects, domain objects are good and service objects are bad
How I wrote a command-line Ruby program to manage EC2 instances for me
My vim setup for Rails

Angular

Getting started with Angular CLI
How to delete an item from a list in AngularJS
How to add a test coverage report to an Angular CLI project

Angular + Rails

Get started with Angular 4 and Rails 5
How to deploy an Angular CLI webpack project to Heroku
How to deploy an Angular 2/Aails 5 app to Heroku
How to deploy an Angularjs/Rails single-page application to Heroku
How to deploy a Rails application with an Angular CLI Webpack front-end

General programming

All my best programming tips
Stuck on a programming problem? These tactics will get you unstuck about 99% of the time
Variable name anti-patterns
Common legacy project challenges and how to address them
Unlike real debt, technical debt is unavoidable
The difference between domains, domain models, object models and domain objects
Who’s to blame for bad code? Coders.
“Perfect is the enemy of the good” is a false dichotomy
“It’s ugly but it works”
Why small stories are better than big ones
Refactorings should be atomic
Why the boy scout rule is insufficient
My favorite debugging techniques
My first attempt at a genetic algorithm
My second attempt at a genetic algorithm

Non-Technical Articles

How to get traffic for a technical blog
How to make your organization attractive to engineering talent
How to get a team to get behind an engineering project
My experience speaking at 7 tech conferences in 9 months including RailsConf, RubyHACK and RubyConf India

Talks/Videos

RailsConf 2019 – Coding with an Organized Mind
RubyHACK – Using Tests as a Tool to Wrangle Legacy Projects
RubyConf India – Using Tests as a Tool to Wrangle Legacy Projects
Chicago Angular Meetup – Introduction to Angular 2