RSpec 3 allows chaining multiple expectations
Multiple RSpec checks on one subject can be chained with and or or, avoiding repeated setup and keeping a single call under test.
Disable SimpleCov if you only run a fraction of your tests
Coverage reports add noise when only a small subset of tests runs; skipping SimpleCov for partial runs keeps output cleaner.
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.
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.
Rails and Postgres: How to test if your index is used as expected
Rails and Postgres index usage can be verified by running the generated SQL with EXPLAIN ANALYZE and temporarily disabling sequential scans.
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.
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.
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.
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.
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.
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.
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.
CarrierWave: Default Configuration and Suggested Changes
CarrierWave defaults often need project-specific tweaks for storage paths, cache cleanup, test isolation, and large-file handling.
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.
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.
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.
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.
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.
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.
Jasmine: Dealing with Randomness
Random behavior in Jasmine tests makes results unstable unless spyOn controls dependent calls. returnValue, returnValues, and callFake keep shuffles predictable.
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.