Protip: Always leave a failing test

Leaving a failing test at the end of unfinished work makes it easier to resume later and quickly see what still needs attention.

Setup your terminal to not scroll when there is new output

Stop the terminal from jumping back to the bottom when new output appears, so you can inspect logs or test failures without losing your place.

CSS tests and experiments

Tests and experiments around CSS features, possibilities, and browser bugs across more than 200 cases.

JavaScript: Testing whether the browser is online or offline

Browser connectivity can be misleading: navigator.onLine often stays true without usable internet. A real fetch with timeout can confirm whether requests actually work.

Test that a CSS selector is present with Cucumber

Cucumber step for checking whether a CSS selector is present or absent on a page with Capybara or Webrat.

Stubbing out external services with an embedded Sinatra application

Test suites that depend on remote APIs can become brittle and slow; an embedded Sinatra app provides a lightweight stub server for isolated integration tests.

Using QEMU to quickly test an ISO or bootable USB drive

Bootable media can be tested quickly in QEMU instead of setting up VirtualBox, using an ISO or a USB drive directly.

Hunt down that elusive debug message in Ruby

Trace stray puts and p output in Ruby by inserting a temporary hook that prints a backtrace for a chosen message, then remove it after cleanup.

Use the back button in Cucumber

Navigate to the previous page in Cucumber feature tests when browser history is unavailable, using the HTTP referrer in Capybara or Webrat.

Carrierwave: Built-in RSpec matchers

CarrierWave RSpec matchers simplify testing uploaded image versions and dimensions with have_dimensions, be_no_wider_than, and be_no_larger_than.

How to test if an element has scrollbars with JavaScript (Cucumber step inside)

Detecting overflow in an element matters when layout must avoid hidden content and unwanted scroll bars; comparing scrollHeight and offsetHeight reveals whether content exceeds the visible area.

How to test whether your device has a true Retina display

A simple visual test gauges how close a screen comes to true Retina quality by comparing fine line sharpness in two images.

Airbrake notification in Rake tasks

Rake tasks can report exceptions to Airbrake without notifying in development or test environments, using the usual notification rules for tasks that depend on :environment.

Updated: Capybara: Check that a page element is hidden via CSS

Hidden-element checks in Capybara can fail in Selenium when visibility is inferred too loosely. A JavaScript-based step works across Selenium, jQuery, Prototype, and Rack::Test.

Stub methods on any instance of a class in Rspec 1 and Rspec 2

Stub a method on every instance of a class to control behavior in tests, using stub_any_instance, any_instance.stub, or allow_any_instance_of.

Geordi 5.4.0 released

Geordi 5.4.0 adds geordi branch, MySQL dump speedups, Pivotal Tracker ID support in global config, and fixes for dump load requirements and test processor documentation.

FactoryGirl: How to easily create users with first and last name

Create a user factory that accepts one full-name value and splits it into first and last name automatically, reducing repetitive test setup.

Common mistakes when storing file uploads with Rails

File uploads in Rails are easy to misconfigure, causing lost files, public exposure of confidential data, and environment collisions. Existing uploads also need migration when storage paths change.

Create and send any HTTP request using the Postman request builder

Postman provides a graphical way to build and send HTTP requests, with collections, environments, history, and a cookie manager for API testing.

Updated: Test a gem in multiple versions of Rails

Testing a gem across Rails versions is easier with shared app code and specs via symlinks, keeping one test setup aligned with current best practice.

How to inspect controller filter chains in specs

Inspecting callback chains in controller specs helps verify before- and after-action behavior, especially when tests need to confirm filter order or presence.

Jasmine 2 cheat sheet for RSpec lamers

Quick RSpec-to-Jasmine 2 reference for matching expectations and mock assertions when switching test style; Jasmine 1.x uses different syntax.

Webpack(er): A primer

Webpacker integrates webpack with Rails to bundle JavaScript, stylesheets, images, and other assets, with Yarn managing dependencies and loaders handling non-JavaScript files.

thoughtbot/fake_stripe: A Stripe fake so that you can avoid hitting Stripe servers in tests.

fake_stripe runs a local Stripe-like server and fake Stripe.js for feature specs, letting purchase flows be tested without external HTTP requests or Stripe sandbox flakiness.