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.
mattheworiordan/capybara-screenshot
Automatically saves failed Capybara test HTML and screenshots to tmp/capybara, helping diagnose flaky browser failures in Cucumber, RSpec, and Minitest.
mattheworiordan/capybara-screenshot
Captures browser screenshots on demand or automatically when tests fail, making visual debugging of Capybara runs easier.
yujinakayama/transpec: The RSpec syntax converter
Script to migrate test suites from RSpec 2 to RSpec 3, including syntax beyond should and expect.
colszowka/simplecov - GitHub
Ruby 1.9 code coverage tool with configurable reporting and automatic merging across test suites; rcov remains for Ruby 1.8.
Capistrano: exclude custom bundle groups for production deploy
Custom Bundler groups can still be downloaded during Capistrano deploys, slowing production and staging releases. Exclude unnecessary groups with bundle_without to avoid installing unused gems.
Error during Rails 5 upgrade: Environment data not found in the schema
Rails 5 upgrade can fail when the database schema lacks configured environment data, especially during parallel test database migration.
Wrapping Your API In A Custom Ruby Gem
Packaging API bindings as a custom Ruby gem makes reuse and distribution easier, with tests recording HTTP interactions through VCR.
Heartbleed test
Checks a server hostname for the Heartbleed vulnerability in OpenSSL (CVE-2014-0160).
How to test inside iframes with cucumber / capybara
Cucumber and Capybara ignore iframes by default, so tests must switch into the frame to interact with its content. Frame-aware step definitions can reduce repeated setup.
Maintaining custom application tasks in Rails
Large Rails projects benefit from keeping application tasks slim, separating the executable wrapper from the business code, and testing both rake tasks and scripts.
Webservice to test and inspect requests
Temporary request URLs make it easy to inspect HTTP callbacks and webhooks; incoming traffic is recorded and displayed for debugging.
Error handling and reporting with Rails
Rails exception handling can either crash requests, hide actionable errors, or spam trackers; ExceptionApp, DebugExceptions, and the error reporter shape responses, logging, and notifications.
Rails: Reporting CSP Violations to a log file
Capture CSP violation reports in a log file to spot blocked resources and browser-extension noise, with a dedicated Rails endpoint for incoming reports.
Regular Expressions - Cheat Sheet
Regular-expression syntax for matching characters, boundaries, alternation, quantifiers, look-arounds, and Ruby modifiers. Useful for writing and debugging patterns safely.
Cucumber CI job quirks
Cucumber CI rerun logic can pass green after syntax errors when no failing_features file is written; native --retry avoids this edge case.
VCR fails if the same request is triggered multiple times
VCR records each request only once, so replaying repeated identical calls can fail unless allow_playback_repeats is enabled.
Beware: Coffeescript "in" is not the Javascript "in"
CoffeeScript in checks array membership, not object properties; JavaScript in tests whether an object has a property. Use of for property lookup in CoffeeScript.
Transactional HTML Email Templates
HTML email styling is fragile across clients and devices, making transactional messages hard to build and test. Open-source templates reduce the work needed for common transactional emails.
Can I Email: Check what styling email clients support
Email client styling support is fragmented, so feature checks help avoid unsupported CSS but cannot replace real-client rendering tests.
JustinFrench.com: Learn how to test your code
Eventually you’ll forget that you used to spend hours testing your code in a browser, and start complaining that your automated tests are taking minutes to run! You’ll have intense debates with co-workers about what to test and how to test it properly. You’ll start writing the test first to expose the bug or missing feature, then write the code required to pass the test.
Jasmine: Fixing common errors during initialization
Jasmine boot failures can stem from browser/module detection issues, causing jasmineRequire or getJasmineRequireObj() errors in Webpacker and esbuild setups.
Check if an object is an ActiveRecord scope
Checking for an ActiveRecord scope with is_a?(ActiveRecord::NamedScope::Scope) breaks in Rails 3 and misses unscoped model classes. respond_to?(:scoped) is a broader check.