Rails Env Widget
A small helper adds a dismissible on-screen badge showing the current Rails environment to prevent confusion between development, test, and production.
Silencing Deprecation Warnings in Rspec
Deprecated Ruby tests can flood RSpec output with warning noise. A narrower way to quiet them avoids hiding warnings from dependencies.
How Haml 6 changes attribute rendering, and what to do about it
Haml 6 renders most custom attributes verbatim, so falsy values no longer remove them. Boolean attributes keep special handling, and Haml::BOOLEAN_ATTRIBUTES can extend that list.
How to install the `xelatex` binary on Ubuntu 14.04
Missing xelatex causes RTeX::Document::ExecutableNotFoundError during tests; installing texlive-xetex on Ubuntu 14.04 provides the binary.
Accessing JavaScript objects from Capybara/Selenium
Capybara and Selenium can access only browser globals, so exported JavaScript modules fail in evaluate_script unless the component instance is attached to the element.
Code splitting in esbuild: Caveats and setup
esbuild code splitting can reduce main-bundle size, but multiple entry points, chunk cascades, and import-order changes can break builds or runtime behavior.
Skip Selenium scenarios in a Cucumber run
@javascript Cucumber scenarios run with Selenium and can slow down test runs; cucumber --tags ~@javascript skips them when needed.
How to generate and test a htpasswd password hash
Create and verify bcrypt password hashes for Apache authentication, with safer handling than command-line password entry.
Why your Cucumber feature loses cookies when run under Selenium
Cucumber/Selenium tests can lose cookies and sessions when the app and browser run in different times, because old dates make cookies expire immediately.
Test that a hash contains a partial hash with RSpec
Use hash_including in RSpec to verify a hash or method call contains only the expected key-value pairs without matching the full structure.
Turn off SSL for scenarios with Selenium
Selenium on WEBrick fails on HTTPS pages because the server does not speak SSL. Disabling SSL only for those scenarios avoids Cucumber browser test failures.
Selenium WebDriver 2.5.0, 2.6.0 fails when selecting options from select boxes
selenium-webdriver versions after 2.5.0 can make Capybara fail to choose <select> options even when the option is present, affecting Firefox tests.
Parallel cucumber: How to pass in cucumber arguments
Pass Cucumber CLI flags such as --tags through parallel_cucumber by wrapping them in --cucumber-options when running test shards.
RSpec: automatic creation of VCR cassettes
RSpec examples tagged :vcr automatically record and replay HTTP cassettes, while untagged specs block network calls unless HTTP access is explicitly enabled.
Insomnia helps you querying your API
GUI client for testing and communicating with APIs; a less cluttered alternative to Postman and cURL, available via snap or Ubuntu packages.
HTML: Making browsers wrap long words
Long words can overflow layouts when browsers wrap only at word boundaries. CSS hyphenation, soft hyphens, <wbr>, and overflow-wrap offer different control levels.
makandra/capybara-lockstep
Flaky end-to-end tests often fail because Capybara outpaces client-side JavaScript and AJAX; synchronizing commands with browser activity makes full-stack integration suites more stable.
Error "execution expired (Timeout::Error)" when using Selenium and Webmock
Bulk test runs can fail with execution expired (Timeout::Error) when Selenium and WebMock interact; upgrading WebMock to 1.7+ resolves the timeout issue.
Test that a form field has an error with Cucumber and Capybara
Capybara and Cucumber can assert field validation errors by checking for .field_with_errors around a named form field.
RSpec: Inferring spec type from file location
RSpec Rails can infer spec behavior from file location, removing manual type tags and enabling request helpers like get and post where appropriate.
On Being A Journeyman Software Craftsman: Test-first and Test-driven conversation with JB Rainsberger
We had a conversation about the fact that the 'TDD is about testing vs TDD is about design" debate that keeps popping up, especially now in the Ruby community.
Upgrading Rails 2 from 2.3.8 through 2.3.18 to Rails LTS
Rails 2.3.x upgrades fix security vulnerabilities and API changes across patch levels, with extra CSRF, XSS, and JSON gem updates needed on some releases.
Type text into Javascript prompt dialogs in Capybara/Selenium
Automated tests need a way to enter text into JavaScript prompt dialogs in Capybara/Selenium. Browser dialog handling can block workflows unless the prompt input is filled correctly.
Cucumber step to test that a tooltip text exists in the HTML
HTML-attribute tooltips are entity-encoded, so presence checks need decoded text or encoded matching in Capybara.