When you're nesting setTimeout(f, 0) calls, your browser will silently increase the delay to 5 milliseconds after the...

When your controller action raises an unhandled exception, Rails will look at the exception's class and choose an appropriate...

When building a web application, one is tempted to claim it "done" too early. Make sure you check this list...

makandra dev
phrogz.net

...The and tags both come with some non-default behavior that you know from other tags.

The following will search for all .feature files containing a search term and run them using geordi. find features/ -name...

Reading user input in console applications is usually done using Kernel#gets. Stubbing that can be a bit hairy.

When testing Ruby code that prints something to the terminal, you can test that output. Since RSpec 3.0 there is...

willmore.eu

The linked site hosts a simple test. It shows two images with narrow vertical/horizontal lines. The more they resemble each...

At least Selenium cannot find disabled fields. Unless you find them explicitly: find_field 'This is disabled', disabled: true

makandra dev
browsercookielimits.squawky.net

TL;DR If you want to support most browsers, then don't exceed 50 cookies per domain, and don't...

Spreewald gives you the within meta step that will constrain page inspection to a given scope. Unfortunately, this does not...

relishapp.com

When you find yourself in the situation that you would like to define a custom matcher in your specs, but...

To delay your entire Jasmine test suite until the DOM is ready, add the following: beforeAll(function(done) { $(done); });

github.com

fake_stripe spins up a local server that acts like Stripe’s and also serves a fake version of Stripe.js...

Expecting a primitive value as an argument to a method invocation is easy: expect(object).to receive(:foo).with('arg1...

developer.mozilla.org

When building a form with a file select field, you may want to offer your users a live preview before...

Cucumber's docstrings let you add long strings to a step like this: # foo.feature Given this text: """ First line

OAuth requires a set of params to be carried along requests, among which a nonce. Some libraries pass these along...

RSpec provides a nice diff when certain matchers fail. Here is an example where this diff is helpful while comparing...

Don't write resources :people, :concerns => :trashable Write resources :people do concerns :trashable end Why Writing a controller...

Let's say you want to find the element with the text hello in the following DOM tree: hello

Our preferred way of testing ActiveRecord is to simply create/update/destroy the record and then check if the expected behavior has...

RSpec supports a one-liner syntax for setting an expectation on the subject: describe Array do describe "when first created...

Validations should be covered by a model's spec. This card shows how to test an individual validation. This is...