RSpec Argument Matchers: Expecting non-primitive objects as method invocation arguments
RSpec can verify method arguments that are objects by class, interface, attributes, equality, or custom block checks instead of simple primitive values.
Fix randomly failing PDF cucumber tests
PDF Cucumber tests can fail intermittently on the first run when generation is not ready. A readiness step waits for PDF output before checking contents.
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.
Check that an element is hidden via CSS with Spreewald
CSS-hidden text can pass Rack::Test because it inspects only the DOM, while Selenium checks actual visibility for user-facing content.
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.
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.
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.
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.
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.
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.
Selenium: Network throttling via Chromedriver
Throttle headless Chrome network conditions in Selenium to debug flaky integration tests and simulate slow page loads.
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.