Jasmine: Testing AJAX calls that manipulate the DOM
AJAX DOM updates are hard to test when requests are asynchronous and the target element is missing. jasmine-ajax, jasmine-fixture, and done make network mocking and DOM setup possible.
Consul: Querying a power that might be nil
Authorization checks stay safe when Power.current is missing, so models can run in consoles, tests, and batch jobs without crashing.
Bundler for Rails 2.3.x
Bundler support for Rails 2.3.x requires updated RubyGems and Passenger, a bundled Gemfile workflow, and bundle exec for tests and deployment.
Testing focus/blur events with Cucumber
Firefox and Selenium can delay real blur events in Cucumber tests, making focus-dependent listeners hard to exercise; ChromeDriver and a custom event workaround avoid the issue.
Test meta-refresh redirects with Cucumber
Capybara step for asserting a meta refresh redirect in the page head during Cucumber feature tests.
Using Spring and parallel_tests in your Rails application
Spring keeps bin/rails and bin/rspec fast, while parallel_tests can break shared test runs unless Spring is disabled in parallel contexts.
Cucumber Webrat steps
Custom Cucumber step definitions for checking fields, HTML content, regex matches, and table data in Webrat-based tests.
Cucumber / Selenium: Access and test document title
Verify that page titles contain expected text during browser tests with Selenium and Cucumber, avoiding mismatches in document title assertions.
Hide your Selenium browser window with a VNC server
Run Selenium tests in a hidden X session with vncserver, keeping the browser accessible for inspection without adding a gem.
Rails: Parsing a time in a desired timezone
Create a Time in a fixed timezone regardless of Rails or system settings; useful for tests and API date comparisons when parsing otherwise shifts by environment.
Selenium: Network throttling via Chromedriver
Throttle headless Chrome network conditions in Selenium to debug flaky integration tests and simulate slow page loads.
Geordi 1.0 released
Geordi 1.0 consolidates Rails project commands into a single CLI with command lookup, dependencies, and new setup, update, console, shell, and test workflows.
How to communicate between processes in Ruby with sockets
Interprocess communication in Ruby can use UNIX sockets for parent-child coordination, parallel test synchronization, and waiting for child cleanup after fork.
Don't call #node on a Capybara element
Capybara elements become driver-specific when #node is used, breaking code that should work across Rack::Test and Selenium. Prefer the driver-neutral Capybara API for searches and interactions.
Things to consider when using Travis CI
Fragile CI builds on Travis often fail with Ruby 1.8.7, incompatible Rubygems, or debugger gems in the test bundle.
Manually requiring your application's models will lead to trouble
Manually requiring Rails models can load classes twice and trigger duplicate validations or other subtle test failures. Let Rails autoload models or require them by the same path Rails uses.
Undefined method log for Selenium::WebDriver::Remote::W3C::Bridge
Integration tests can fail with undefined method log on Selenium::WebDriver::Remote::W3C::Bridge after enabling Selenium W3C mode; upgrading Capybara restores browser log access.
Test the status code of a response in Cucumber
Checking response status in Cucumber can verify error handling and redirects during acceptance tests. Webrat and Capybara expose status information for custom step definitions.
Deal with certain travis CI failures
Travis CI builds can break after Ubuntu image changes, causing PostgreSQL, MySQL, and Rails test failures. Pinning dist: trusty keeps the older environment until the setup is updated.
Test downstream bandwidth of Internet connection
Check whether an internet uplink can sustain 1GE or 10GE throughput by pushing traffic internally or from many public mirrors.
How to change the hostname in Cucumber features
Capybara defaults to www.example.com, which can hide hostname-specific behavior in feature tests. Stubbing app_host lets scenarios run against a chosen host without leaking into others.
Test that a number or money amount is shown with Cucumber
Reliable Cucumber checks for displayed numbers and monetary amounts prevent false positives from partial matches and accept spaces or nonbreaking spaces before units.
Best practices: Large data migrations from legacy systems
Large legacy data migrations need deep source-system understanding, fast failure, dedicated logging, and traceable migration metadata to keep long-running imports debuggable and verifiable.
parallel_tests: Disable parallel run for tagged scenarios
Tag specific Cucumber scenarios so they avoid running together when they contend for a shared resource or browser focus, at the cost of slower tests.