How to allow testing beforeunload confirmation dialogs with modern ChromeDrivers

ChromeDriver 127 closes beforeunload prompts immediately in HTTP sessions; BiDi mode with unhandled_prompt_behavior: { default: 'ignore' } keeps them open for automated tests.

How to use a local gem in your Gemfile

Use a local gem copy in Gemfile to test code changes immediately and debug or modify the gem without publishing. Avoid committing local paths because they break for other developers.

Debugging Rails Active Jobs with the Vanilla Adapters

Rails jobs can be hard to inspect because adapters behave differently in development, test, and production. Logging, synchronous execution, and queue tables help trace failures and pending work.

RSpec: How to aggregate failures

aggregate_failures in RSpec groups multiple expectation failures in one example, improving test feedback and making debugging mismatched values easier.

Testing ActiveJob `limits_concurrency` with Solid Queue

ActiveJob concurrency checks can pass falsely with the :test adapter because blocked jobs still enqueue; using :solid_queue verifies real blocking behavior.

Why two Ruby Time objects are not equal, although they appear to be

Time comparisons can fail in tests because Ruby keeps subsecond fractions even when the printed values look identical.

CarrierWave: Default Configuration and Suggested Changes

CarrierWave defaults often need project-specific tweaks for storage paths, cache cleanup, test isolation, and large-file handling.

Rails: Testing exceptions with the rescue_responses setting

Rails 7.2 changes show_exceptions defaults in tests, so rescued RecordNotFound often becomes a 404 response instead of a raised exception.

Managing chrome versions for selenium

Browser and driver mismatches can break Selenium tests; Selenium Manager can fetch matching Chrome and chromedriver versions automatically, though the first run is slower.

How to use Simplecov to find untested code in a Rails project with RSpec and Cucumber

Code coverage reveals untested Rails paths and blind spots across RSpec, Cucumber, and parallel test runs. SimpleCov can separate reports and add branch coverage.

RSpec: Debug flickering test suites with rspec --bisect

Randomized RSpec order can expose order-dependent failures that pass alone but fail in full runs; rspec --bisect finds a minimal reproducer for the offending interaction.

Jasmine: Preventing unhandled promise rejections from failing your test

Async rejections can fail Jasmine tests as unhandled promise rejections when the promise is not awaited or returned. jasmine.spyOnGlobalErrorsAsync() lets tests ignore or inspect the global error.

RSpec: Marking sections in long examples

Long RSpec examples are hard to scan and slow to report progress. A small STEP helper adds semantic section markers and clearer test output.

How to not repeat yourself in Cucumber scenarios

Avoid duplicated Cucumber scenarios by sharing setup and assertions with step composition, helper modules, or scenario outlines. Better reuse keeps integration tests DRY and stack traces readable.

Choosing the right gems for your project

External libraries add maintenance and security risk, so picking a Ruby gem needs attention to necessity, test quality, license, maturity, and scope fit.

Using Rationals to avoid rounding errors in calculations

Exact fractions in Ruby prevent rounding drift in unit conversions and tests, but mixing Rational with BigDecimal or floats can still reintroduce inaccuracies.

RSpec: How to retry examples

Flaky RSpec examples can be retried a limited number of times in CI instead of failing immediately, using rspec-rebound with configurable retry settings.

Geordi: How to rerun failed features

Rerun failing Cucumber scenarios automatically or from tmp/parallel_cucumber_failures.log when a test run leaves broken features behind.

Rails: Using require and permit for attributes

Stricter strong parameters raise missing and unpermitted attribute errors during development and tests, helping catch bad requests earlier while requiring environment-specific handling in production.

Avoiding Test-Case Permutation Blowout - Steven Hicks

Business-rule tests with multiple variables can explode into 2n permutations. An n+1 pattern keeps coverage manageable while making individual cases easier to follow.

Rails: Your index actions probably want strict_loading

Strict loading in index actions catches N+1 queries when views touch unpreloaded associations, causing test failures instead of hidden database hits.

You don't always need a custom matcher to write clean RSpec tests

Repeated RSpec assertions can be extracted into custom matchers, but some cases are better served by private helper methods when reuse would be too awkward.

Jasmine: Dealing with Randomness

Random behavior in Jasmine tests makes results unstable unless spyOn controls dependent calls. returnValue, returnValues, and callFake keep shuffles predictable.

Chromedriver: Connect local chromedriver with docker

Remote Chrome debugging in Docker is awkward when integration tests need a browser you can inspect. SSH port forwarding can expose a local chromedriver inside the test container.