NoMethodError: undefined method `cache' for Gem:Module
Rails 2.3 tests can fail with NoMethodError: undefined method 'cache' for Gem:Module when used with newer RubyGems; downgrading RubyGems restores generator lookup behavior.
Testing Accessibility using Orca
Linux screen reader testing can be noisy and hard to inspect; capturing Orca speech in real time makes spoken output readable during accessibility checks.
Cucumber: Removing uploaded files after test runs
Uploaded test files can linger after Cucumber feature runs; placing cleanup code in features/support/ removes them automatically.
Pierce through Javascript closures and access private symbols
Accessing state hidden in JavaScript closures can simplify tests and let Jasmine spies mock private methods or inspect local variables.
Test that a select field contains an option with Cucumber
Cucumber steps can verify that a form select contains or excludes a specific option, without checking the currently selected value.
Capybara: How to find a hidden field by its label
Hidden form inputs are ignored by default in Capybara, causing find_field to fail unless type: :hidden is specified. This helps when tests must wait for JavaScript widgets to populate a field value.
Rails: Default generators
Default Rails generators create different combinations of models, controllers, migrations, routes, views, and tests, helping choose the right generator from the command line.
ActiveRecord: count vs size vs length on associations
size is usually the right way to count associated records in Rails; count can ignore loaded children, while length loads everything.
RSpec expects pending tests to fail
Pending RSpec examples need a failing body; otherwise a passing pending example is treated as a failure. Omit the body, add fail, or skip with xit/xdescribe.
How to solve Selenium focus issues
Browser focus loss makes Selenium tests flicker red and green, especially with Firefox and parallel runs. Explicit focus and blur handling and focus-independent tests improve stability.
Aggregated RSpec/Cucumber test coverage with RCov
RCov defaults fail to aggregate RSpec and Cucumber coverage cleanly; a custom rake rcov:all task produces a Rails report for app/**/*.rb only.
How to remove RSpec "old syntax" deprecation warnings
RSpec 3 deprecates :should expectations, causing warnings in older test suites and gems that need backward compatibility. RSpec.configure can re-enable both syntax styles.
Removing MiniTest warnings from Rails 4 projects
MiniTest deprecation warnings in Rails 4 often come from older test gems using the outdated API; adding minitest can silence one warning, but some require gem updates.
Tearing Down Capybara Tests of AJAX Pages
Pending AJAX requests can die when a Capybara test ends or switches scenarios, causing flaky JavaScript specs. Waiting for the page to load helps avoid the failure.
How to silence thin boot messages
Thin prints startup messages that clutter parallel test output. Logging can be silenced with Thin::Logging.silent = true or redirected to a custom logger.
How to change will_paginate's "per_page" in Cucumber features
Pagination tests in Cucumber often need fewer records than the default will_paginate page size. Stubbing per_page per model keeps feature scenarios small.
Rules of thumb against flaky specs
Flaky specs often come from brittle matchers, nondeterministic record limits, and UI components that load or animate asynchronously.
Hack of the day: One-liner to run all changed Cucumber features
Run only modified or new Cucumber feature files from git status, reducing test time by avoiding unchanged specs.
Prevent your Firefox from auto-updating
Freezing Firefox versions for broken Selenium tests is a poor long-term fix because old releases stop receiving security patches. Auto-update can be disabled via about:config, but keeping Firefox current is safer.
Rspec: How to write better specs
RSpec tests are easier to maintain with clearer structure and disciplined style, but recommendations still need judgment; the Self-Contained Test is a complementary approach.
Capybara: Trigger requests with custom request method
Capybara request helpers can send non-GET actions for destructive tests, letting RackTest and Selenium submit DELETE requests instead of only visiting pages.
Geordi 5.4.0 released
Geordi 5.4.0 adds geordi branch, MySQL dump speedups, Pivotal Tracker ID support in global config, and fixes for dump load requirements and test processor documentation.
Perform HTTP basic authentication in Cucumber (with or without Selenium)
Cucumber step for HTTP basic auth in Capybara, Rack::Test, or Selenium when visiting protected admin pages via path_to.
Javascript: How to match text by Unicode properties
Unicode character class escapes let JavaScript regular expressions match letters, numbers, and symbols beyond ASCII, making password checks work with umlauts and non-Latin digits.