Delete all MySQL records while keeping the database schema
Clear MySQL data without dropping tables, useful after bad migrations or frozen tests. DatabaseCleaner truncation keeps the schema intact and can be wrapped in a Rake task.
New Firefox and gem versions for our Selenium testing environment (Ubuntu 14.04+)
Firefox 5.0.1 no longer runs on Ubuntu 14.04, so Selenium test setups need browser and gem updates to keep Rails 2.3 and Cucumber projects working.
Testing setTimeout and setInterval with Jasmine
jasmine.clock() lets tests fast-forward timers and trigger setTimeout or setInterval callbacks without waiting in real time.
VCR and the webdrivers gem
VCR can complain when webdrivers checks the internet for driver updates during tests. Updating locally, ignoring the update host, or pinning the driver version avoids the noise.
Capybara 2.0 has been released
Capybara 2.0 breaks compatibility with 1.x and drops Ruby 1.8 support. It changes Rails integration test conventions, element matching, and RSpec syntax.
Mocking time in Jasmine specs
Control time in Jasmine tests with the built-in jasmine.clock() to fake timers and new Date() without adding SinonJS.
Pattern: Disabling a certain feature in tests
Integration tests often break on cookie banners or captchas. A test-only switch disables them by default while allowing targeted reactivation for specific cases.
Ruby 1.9 or Ruby 2.0 do not allow using shortcut blocks for private methods
&:test works for private methods in Ruby 1.8 but raises NoMethodError in Ruby 1.9 and 2.0.
Upgrading Ruby from 1.8.7 to 2.3.5
Ruby 2.3.5 migration from 1.8.7 needs gem updates, syntax fixes, and test adjustments to resolve compatibility errors across Rails apps.
SearchableTrait is now a gem: Dusen
SearchableTrait was extracted into the Dusen gem, adding tests, documentation, and a cleaner query syntax for Googlesque searches in models.
Downgrade Firefox 6 to Firefox 5 on Ubuntu
Firefox regression can break Selenium tests after an upgrade; running an older browser is unsupported and may leave the system unstable.
Ruby: How to use prepend for cleaner monkey patches
prepend makes Ruby monkey patches cleaner by inserting an extension before the original implementation, so super still reaches it and ancestor chains stay readable.
Test xpath expressions in your browser
Test XPath queries directly in the browser console to inspect page elements without extra tools; Safari, Chrome, and Firefox support this in different ways.
Sending errors to sentry from development
Enable Sentry reporting in development to verify setup changes, using Raven and temporary test messages while avoiding committed debugging noise.
Geordi 1.5.1 released
Geordi 1.5.1 adds smarter command handling for test selection, stage lookup, server ports, and LAN access, plus a firefox --setup version check fix.
Test that an exception or error page is raised in Capybara
Capybara error-page assertions rely on the response status code and require @allow-rescue; Selenium @javascript scenarios do not support page.status_code.
Project management best practices: Technical debt summary
Prioritizing refactoring and upgrade work is harder in larger projects; a maintained technical-debt summary helps compare effort, customer value, and developer value.
Test whether Perfect Forward Secrecy (PFS) is enabled on a server (using OpenSSL)
openssl s_client can verify whether a server supports Perfect Forward Secrecy by checking if a cipher handshake succeeds or fails.
Migrating to Spreewald
Migrating an existing cucumber test suite to Spreewald reduces custom step definitions by replacing web, email, shared, and table steps with built-in support.
How to send a test e-mail from shell
Manually verify outbound e-mail delivery from a machine with mail from the shell, either empty or with a typed message body.
Gemspecs must not list the same gem as both runtime and development dependency
Duplicating a gem in both runtime and development dependencies breaks gemspec validation and can make Bundler ignore the package. Put test-only version pins in the Gemfile instead.
How to look at hidden X screens
Hidden X displays can be inspected by taking a screenshot of the active display, including Xvfb-backed sessions used for headless tests.
natritmeyer/site_prism
SitePrism adds a semantic Page Object Model DSL for Capybara acceptance tests, making site interfaces easier to model and query with reusable page and section objects.
Resolving Element cannot be scrolled into view (Selenium::WebDriver::Error::MoveTargetOutOfBoundsError) on Mavericks
Selenium and Cucumber tests on Mavericks can fail with MoveTargetOutOfBoundsError when Firefox starts on a different monitor than the focused Terminal window.