ActiveRecord meets database views with scenic

Use SQL views in a Rails app without switching the schema format to SQL; Scenic adds versioned, reversible migrations and keeps view definitions in SQL files.

Beware: Nested Spreewald patiently blocks are not patient

Nested patiently blocks in Spreewald can disable retries by setting inner wait times to zero, causing flaky Cucumber/Selenium steps.

How to find out which type of Spec you are

Runtime checks can identify the current RSpec spec type, letting shared setup run only for controller, helper, or request/response-aware examples.

factory_bot: Re-use partial factory definitions

Shared factory attributes and traits can be reused across FactoryBot definitions by extracting a trait and mixing it into multiple factories.

Using FactoryBot in Development

Dummy development data is faster to create by reusing FactoryBot factories than by using the UI or Rails console records. Defaults, associations, traits, and attribute overrides come along automatically.

Rails console tricks

Quick console shortcuts for changing receiver context, inspecting objects, making requests, using helpers, and querying schema in a Rails session.

Force SSH client to use password authentication instead of public key

Password authentication can be tested by forcing SSH to skip public key login and prefer passwords. The same options also work with scp for file copies.

VNC browser disappears while typing

Typing d in a Geordi VNC browser can switch to a grey screen; pressing d again brings the browser back.

You can use any RSpec matcher to match arguments of method calls

RSpec method expectations can match arguments with any matcher, not just anything or hash_including, making loose argument checks more expressive.

How to silence UTF-8 warnings on Rails 2.3 with Ruby 1.9

Ruby 1.9 triggers UTF-8 regexp warnings in Rails 2.3.16+ from ActiveSupport; a monkey patch in config/initializers suppresses them.

The Easiest Way to Parse URLs with JavaScript

Parsing URLs is simpler with an <a> element than with new URL(...), and it also handles incomplete relative paths; IE11 may omit the leading slash.

Enabling view rendering for controller specs

Controller specs usually skip template rendering; integrate_views in RSpec 1 or render_views in RSpec 2 enables view rendering for specs that need it.

How to set the default monospace font on Xfce (Xubuntu)

Applications that use the generic Monospace family ignore terminal font settings. A fontconfig override in ~/.fonts.conf can map it to a preferred font.

Change how Capybara sees or ignores hidden elements

Capybara’s default hidden-element handling affects DOM queries globally, while :visible scopes visibility checks to one lookup. Driver-specific visibility rules differ between RackTest and Selenium.

Use byebug on Ruby 2+

debugger is unreliable on Ruby 2; byebug provides a fast, reliable debugger for Ruby 2.0.0+ using TracePoint and Debug Inspector.

Testing regular expressions visually

Complex regex patterns are hard to debug by inspection; visual editors highlight matches and capture groups to make validation easier.

Rails: How to stub the env in Rails 7+

Rails 7.1 adds Rails.env.local?; stubbing Rails.env with a plain string can fail, while ActiveSupport::EnvironmentInquirer keeps environment checks working.

Project maintenance: four levels of code quality

Code quality determines maintainability, from merely working code to reliable, readable, and changeable code. Long-lived projects need at least readable code; short-lived code can stop at reliable code.

Cucumber's table diffing does not play nice with Spreewald's `patiently do`

Cucumber::MultilineArgument::DataTable#diff! caches state, so repeated checks inside patiently do keep failing; expected_table.dup.diff! avoids the stale comparison.

Testing Cookie Limits

Browser cookie storage is constrained by per-domain limits on count and total size, which can break login or tracking data when limits are exceeded.

RSpec: Expect one of multiple matchers to match

RSpec allows chaining matchers with .or, so an expectation passes when any one matcher matches. Useful for Capybara checks across different button renderings.

Ruby: Reading and writing CSVs

Ruby can read and write CSV files with the standard CSV library, and smarter_csv makes imports more convenient when converting rows into hashes.

Sentry Local Logging in Ruby

Local Sentry event logging helps debug error capture and background jobs without sending data to Sentry or affecting production metrics.

Geordi hints

Quick Geordi command shortcuts for guided deployment, setup, security updates, tracker-based commits, and matching ChromeDriver installation.