Don't assert exceptions in feature specs

Capybara feature specs do not reliably catch server exceptions in another thread; request specs or visible UI assertions fit this user-level behavior better.

Delay your Jasmine tests until the document is ready

Jasmine specs can run too early when the DOM is not ready, causing setup to fail. $(done) inside beforeAll waits for document readiness before the suite starts.

Select an unknown option with Capybara

Selecting a dropdown value without knowing the available options helps in tests where only a valid choice is needed. Capybara can read an option from the list and select it by text.

Async control flow in JavaScript: Promises, Microtasks, async/await

JavaScript async code often becomes hard to read and error-prone; promises and async/await flatten control flow, model failures, and avoid callback nesting.

Using ngrok for exposing your development server to the internet

Temporary public access to a localhost development server is useful for testing on another device or through TLS without port forwarding or self-signed certificates.

RSpec: Ensuring a method is called on an object that will be created in the future

RSpec’s and_wrap_original can attach expectations to objects created during a call, making it easier to verify the right validator instance without relying on expect_any_instance_of.

Spreewald 1.2.11 fixes frequent "no alert open" errors on Chrome

Chrome updates can cause frequent no alert open errors in Capybara dialog tests. Spreewald 1.2.11 waits for browser dialogs before confirming them.

Initiate SSL secured TCP connections to remote services

telnet and nc cannot open SSL-secured TCP connections to remote services; openssl s_client can test the connection and handshake.

Auto-generating plain-text bodies for HTML e-mails in Rails apps

HTML e-mails in Rails need a plain-text part to avoid spam penalties; premailer-rails can generate it automatically and be tuned for line length and formatting.

Rails: Use fixture helpers like `users(:alice)` in the Rails console

Rails console fixture lookups are awkward when only fixture names are known; a small initializer adds users(:alice)-style helpers for loaded fixture records.

Testing ActiveRecord callbacks with RSpec

Database-backed RSpec checks for ActiveRecord lifecycle behavior are more reliable than stubs when verifying side effects like automatically creating associated records.

Bash functions to provide repository context for LLM chats

Bash functions package repository context and Git diffs into XML files for Gemini chats, reducing copy-paste friction and API usage.

How to tweak RSpec's truncation behavior

RSpec truncates long inspected values to 200 characters, which can hide the real cause of failing specs. Raising max_formatted_output_length reveals more of the error message.

Bash: How to grep logs for a pattern and expand it to the full request

Find all Rails log lines for matching requests by extracting request IDs and re-grepping the full log, avoiding interwoven output from concurrent requests.

Using Low-Level Prompts for High-Accuracy AI Coding

Precise, low-level prompts and tight context improve AI code edits across files; structured keywords, reusable patterns, and early review reduce guesses and errors.

Howto: Create a self-signed certificate

Local HTTPS development often needs a trusted certificate; openssl or mkcert can create self-signed X.509 certificates for testing without browser warnings.

Testing HTTPS with badssl.com

Sites with unusual HTTPS setups help verify browser certificate handling, proxy interference, and security-product side effects.

Configure RSpec to raise an error when stubbing a non-existing method

RSpec 3.3+ can reject stubbing or mocking methods that do not exist, preventing non-verified partial doubles from masking test mistakes.

Don't use Ruby 1.9.2

Ruby 1.9.2 loads files very slowly, making Rails startup and test runs painfully long. Upgrading to 1.9.3 removes the bottleneck.

Find files modified since a given timestamp

Find files changed after a specific time or within the last day using find age tests and a reference timestamp file.

Heads up: expect(object).to receive(:method_name) does not execute the original implementation of the method

receive(:method_name) stubs the original method implementation, so callbacks or side effects do not run during expectations. and_call_original preserves the real behavior.

How to add esbuild to the rails asset pipeline

Migrating a Rails app from Sprockets-only asset handling to esbuild adds modern JavaScript bundling and can surface path, font, and Sass compatibility issues.

Rspec: Expecting a Rake task to be called

Rake tasks can be verified in RSpec by expecting Rake::Task to receive invoke, useful for testing task-triggered side effects without putting logic in tasks.

New geordi script: migrate-all

Database migration and test preparation in Geordi migrate-all adapt to projects with or without parallel_tests, running the appropriate Rake tasks automatically.