Bash script to list commits by Pivotal Tracker ID

Quickly list Git commits tied to one Pivotal Tracker story ID, making related changes easier to spot with a small Bash helper.

The Startup Toolkit

Practical crash courses for founding a startup, raising funding, and testing ideas before building too much.

Browsera - Automated Cross Browser Web Application Testing Service

Automated cross-browser testing finds layout problems and scripting errors on websites before users do.

Cucumber pitfall: "Around" does not apply to your "Background" steps

Around hooks run only after Background steps, so setup or teardown placed there cannot affect background actions. Use Before and After hooks instead.

Using RSpec stubs and mocks in Cucumber

Cucumber can use RSpec doubles instead of Mocha; loading the integration in env.rb keeps stubs and mocks available after other After hooks.

Bug in Chrome 56+ prevents filling in fields with slashes using selenium-webdriver/Capybara

Chrome 56+ can drop slashes when fill_in runs through Selenium and Capybara, breaking form input for paths and HTML strings; a JavaScript workaround updates the field directly.

RSpec < 2.11: ActiveRecord scopes must be loaded before using the "=~" matcher

ActiveRecord scopes must be converted to arrays before using RSpec =~, or array comparison can fail. match_array and contain_exactly are preferred in RSpec 2.11 and later.

Ruby: How to measure code execution time in an IRB or Rails console

IRB and Rails console sessions can time code execution directly with measure; older versions can use Benchmark.measure for manual timing.

How to find out if you are in Cucumber or in RSpec

Feature and spec code may need different behavior when Rails env is unavailable. Capybara.current_driver can distinguish Cucumber scenarios from RSpec examples.

Ruby: Enumerable#partition

Split an enumerable into matching and non-matching groups with Enumerable#partition, returning two arrays and working naturally with destructuring assignment.

How to fix: WrongScopeError when using rspec_rails with Rails 6.1

rspec_rails with Rails 6.1 can raise WrongScopeError; upgrading the gem to 4.0.1 or later resolves the failure.

Spreewald: Old-school cucumber steps, freshly pickled

Spreewald keeps Cucumber-style web steps available while adding reusable steps for emails, tables and time travel in a Ruby gem.

Output the descriptions of RSpec examples while they are running

RSpec’s nested documentation format prints example descriptions while specs run, making warnings and failures visible immediately and giving a quick view of core behavior.

Testing with IE6, IE7 and IE8 on VirtualBox | Shape Shed

Free browser testing setup on OSX or Ubuntu using VirtualBox makes legacy Internet Explorer versions available without Parallels.

Hack of the day: One-liner to run all Cucumber features matching a given string

Run only matching Cucumber feature files by searching .feature files for a string and passing the matches to geordi cucumber; similar xargs pipelines work without Geordi.

Bash script to run specs and features

Run rspec and Cucumber from any project directory with optional spinner support; features are skipped when specs fail.

How to work around selenium chrome missing clicks to elements which are just barely visible

Chrome/Selenium can miss clicks on barely visible elements when the click target is outside the viewport. A scrollIntoViewIfNeeded patch can work around the issue.

Migrating to RSpec 2 from RSpec 1

Rails 3 requires rspec and rspec-rails 2, with renamed namespaces, changed requires, and macro extensions that may break during migration.

Run your own code before specific RSpec examples

Run custom setup code before selected RSpec examples using metadata tags instead of Cucumber scenarios.

Capybara - The missing API

Capybara node methods for locating elements, filling forms, clicking controls, and checking page content from Cucumber steps.

Issues with has_select?

has_select? can fail with Cucumber, Capybara, and Selenium when the selected option has no value, so driver-specific handling may be needed.

Operators "in" and "of" are very inconsistent between CoffeeScript and JavaScript

in and of mean different things in CoffeeScript and JavaScript, making property checks and iteration easy to mix up.

Fix slow specs using SOLR

Specs can stall for 30+ seconds when SOLR connections are left open and the pool is exhausted. Lowering the old-connection timeout reduces the delay.

Turning off VCR when stubbing with Webmock

VCR can block WebMock stubs because it hooks into WebMock and rejects unknown requests. Temporarily disabling VCR in rspec lets WebMock behave normally.