Setup Sidekiq and Redis
Sidekiq needs a Redis connection configured separately for client and server environments. A REDIS_URL constant and startup load path keep staging, production, and test settings consistent.
Test if all your favicons exist
Favicon variants can break silently when some image sizes or platform-specific tags point to missing files. An integration check can verify that every icon URL returns 200.
How to access Chrome Devtools when running JavaScript tests via CLI
Running JavaScript tests from the CLI bypasses browser DevTools, so debugger statements are ignored. node --inspect-brk lets Chrome DevTools attach to Jest and pause execution.
How to employ and run your tests with parallel_tests to speed up test execution
Parallel test execution can cut long Cucumber, RSpec, or Test::Unit runs by splitting work across CPU cores with parallel_tests and separate test databases.
Mailcatcher: An alternative to inaction_mailer
Local email capture for Rails development avoids lost test messages and lets sent mail be viewed in a browser via MailCatcher.
RSpec: Efficiently rerunning failed examples during development
Persisting RSpec example status lets failed tests be rerun quickly during development with --only-failures or --next-failure.
How to accept or deny JavaScript confirmation dialogs in Capybara/Selenium
JavaScript confirmation dialogs in Capybara/Selenium can block tests or auto-dismiss unexpectedly. Direct alert handling restores accept, dismiss, and text access.
How to make Webpacker compile once for parallel tests, and only if necessary
Compile Webpacker assets once in parallel test runs and skip recompilation when files are unchanged, avoiding duplicate work and Capybara timeouts.
Allow capybara to click on labels instead of inputs for checkboxes
Custom-styled checkboxes with hidden inputs can’t be toggled by Capybara’s check and uncheck; allow_label_click: true lets tests click the label instead.
Geordi 10.0.0 released
Geordi 10.0.0 adds console and test-runner fixes, IRB configuration, and safer PostgreSQL dump restoration, with breaking changes to database drop handling.
How to: Specify size of Selenium browser window
Set a consistent browser viewport for Selenium tests to avoid layout-dependent failures and mobile-versus-desktop behavior differences.
Creating a sample video with ffmpeg
Create tiny test videos with ffmpeg by lowering resolution, framerate, and bitrate to keep files small while preserving duration.
Your Rails sandbox console
rails console --sandbox lets you test database changes in a console session and automatically rolls them back on exit, while file and email actions remain permanent.
Webmock normalizes arrays in urls
Different HTTP clients encode array query parameters differently, and WebMock normalizes them during matching, which can hide real-world crashes in tests.
Test redirects to an external URL with Cucumber/Capybara
External redirects are awkward to test with Cucumber and Capybara: Rack::Test ignores the host, while Selenium follows it. Controller specs or an observable redirect make the target URL verifiable.
Jasmine: Spy on value properties
Jasmine spyOnProperty() fails on plain value fields; a helper can convert them into accessors so they can be stubbed or asserted in tests.
Jest: How to clear the cache
Stale Jest cache can make tests reference refactored code that no longer exists; clearing it with npx jest --clearCache resolves the mismatch.
How to bind an event listener only once with Unpoly
Unpoly event listeners can be limited to a single execution with { once: true } or up.off, useful for tests and callbacks that must not repeat.
Rails: How to check if a certain validation failed
Find out whether a Rails validation failed by checking ActiveModel::Errors types instead of messages, which is useful in tests and for validations with extra options.
Test concurrent Ruby code
Concurrent Ruby code with blocking system calls can fail under Thread-based tests; using forked processes, pipes, and separate ActiveRecord connections keeps synchronization tests reliable.
Migrate gem tests from Travis CI to Github Actions with gemika
Moving gem test suites from Travis CI to GitHub Actions reduces maintenance and aligns CI with current Ruby support. gemika generates the workflow for gems already using it.
Headless Chrome: Changing the Accept-Language header is not possible
Headless Chrome on Ubuntu cannot reliably change Accept-Language through Selenium options; test code can override the header in Rails instead.
Run Selenium tests in Chrome instead of Firefox
Switching Selenium from Firefox to Chrome requires a matching chromedriver and Capybara driver configuration. Older Capybara versions need a manual Selenium WebDriver setup.
Always store your Paperclip attachments in a separate folder per environment
Paperclip attachments can collide across development, test, and parallel test processes when they share one storage tree. Separate environment-specific paths prevent overwritten files and missing test data.