Silence specific deprecation warnings in Rails 3+
ActiveSupport deprecation warnings can be selectively hidden when a specific warning cannot be fixed and only certain messages should stay visible.
RSpec: Defining helper methods for an example group
Helper methods can be defined inside an RSpec example group and inherited by nested groups, but not by parent or sibling groups.
Usage of RSpec's raise_error
raise_error without an expected exception can pass for unrelated bugs, so matching a specific error class and message makes specs meaningful.
Silencing Your Staging Environment - The Hashrocket Blog
Production data testing can accidentally email real users; rewriting recipient domains in ActionMailer prevents staging mail from reaching live inboxes.
DOM API for jQuery users
Quick reference for replacing common jQuery DOM tasks with native browser APIs and handling event delegation gaps without jQuery.
RSpec: ". not_to include" behaves like ".to exclude"
not_to include with multiple values checks each value separately, so one matcher can verify several exclusions at once instead of negating the whole expectation.
How to access before/after pseudo element styles with JavaScript
Pseudo-element styles are hard to inspect directly, but getComputedStyle can read ::before and ::after values for testing and color checks.
Controller specs do not persist the Rails session across requests of the same spec
Controller specs reset the Rails session on every request, so data written earlier disappears between calls. Stubbing controller.session with a shared TestSession preserves state for testing.
PostgreSQL's OVERLAPS operator is not fully inclusive
PostgreSQL OVERLAPS treats date ranges as start <= time < end, so boundary dates are excluded and adjacent ranges do not match.
RSpec: Where to put custom matchers and other support code
Custom RSpec matchers and support code need a clear home in spec/support to keep specs DRY and make shared helpers available everywhere.
RawGit
Serve raw GitHub files with correct Content-Type headers for CDN-style testing or prototyping, but without any uptime guarantee.
How to create Excel sheets with spreadsheet gem and use number formats for cells like money or date
Create .xls files with the spreadsheet gem and apply number formats for currency and dates, including cell links.
RSpec: Where to put shared example groups
Shared example groups need a clear home in RSpec, since the default rspec-rails layout does not provide one. Organizing them in dedicated shared_examples folders keeps them reusable and easy to load.
Working around OpenSSL::SSL::SSLErrors
Ruby and curl requests can fail when a server only accepts older SSL/TLS versions; forcing a specific protocol version can restore connectivity.
Upgrade guide for moving a Rails app from Webpack 3 to Webpack 4
Webpacker 4 and Babel 7 change config files, package names, asset paths, and polyfill imports when upgrading a Rails app from Webpack 3.
Migration from the Asset Pipeline to Webpacker
Moving a Rails app from the Asset Pipeline to Webpacker requires inventorying bundled libraries, repackaging legacy assets, and adjusting deployment for pack-based assets.
How to upgrade Cucumber on Rails 3+
Updating Cucumber on Rails 3+ requires refreshing cucumber, capybara, and cucumber-rails, then restoring any custom support setup after installation.
Spreewald 1.2.0 released: new "select field should be sorted" step
Bugs in select-field ordering can make form choices appear in the wrong sequence; a sorting check helps verify ordered and unordered dropdowns behave correctly.
VCR: An OAuth-compatible request matcher
OAuth query parameters with nonces or timestamps make VCR request matching fail because each URI changes. A custom matcher can ignore the variable OAuth values.
Cucumber: How to find unused step definitions
Cucumber can list step definitions separately, helping detect dead or duplicate steps before cleanup. --dry-run and --format stepdefs reveal candidates, but nested step calls can look unused.
Better output for Cucumber
cucumber_spinner adds a progress bar for Cucumber features and shows failing scenarios immediately, with optional browser opening for failed pages.
FactoryBot: Passing attributes to associated records using transient attributes
FactoryBot transient attributes can pass custom values into associated records, letting parent factories build children with dynamic names and flags.
Chaining Capybara matchers in RSpec
Chaining Capybara matchers with and retries the full expectation when one check fails, making multiple assertions more reliable on pages that change asynchronously.
How to avoid ActiveRecord::EnvironmentMismatchError on "rails db:drop"
Rails database tasks can fail with ActiveRecord::EnvironmentMismatchError after restoring a dump from another environment. Updating ar_internal_metadata or disabling the environment check lets rails db:drop proceed.