Note that if you plan to freeze your Firefox versions because your Selenium tests break whenever Firefox updates, there is...

Sometimes the Rails helper #distance_of_time_in_words is using too much magic. When you need a time difference...

Detecting if a Javascript is running under Selenium WebDriver is super-painful. It's much easier to detect the current...

Hint: There's another card with this helper for Cucumber features. Sometimes you feel like you need to stub some...

makandra dev

The Capybara API is somewhat hard for parse for a list of methods you can call on a Capybara node...

tl;dr: Always have your attachment path start with :rails_root/storage/#{Rails.env}#{ENV['RAILS_TEST_NUMBER']}/. The directory where you...

Don't simply test for the presence of the magic Paperclip attribute, it will return a paperclip Attachment object and...

When your Cucumber feature needs to browse the page HTML, and you are not sure how to express your query...

paperplanes.de

This post is not about devops, it's not about lean startups, it's not about web scale, it's...

robots.thoughtbot.com

I think this pattern is really useful not just for upgrading suites from Webrat, but really anywhere you have an...

This is now part of geordi. Please don't follow the instructions below, if you use geordi. Inspired by the...

When you have a program running in a hidden X screen (like with Xvfb for Selenium tests) you may want...

Note: While the solution in this card should still work, we prefer another solution now: Hide your Selenium browser window...

This note describes how to kick a user out of a Rails application after she hasn't requested an action...

This finally works: User.any_instance.should_receive(...) as does User.any_instance.stub(...) Note: You won't have RSpec 2.6 if you're still working...

API breakage ahoy. You need to either upgrade your Capybara or downgrade your selenium-webdriver gem. Alternatively, this could solve...

Sometimes you need a file of some size (possibly for testing purposes). On Linux, you can use dd to create...

When you generate a URL in a mailer view, ActionMailer will raise an error unless you previously configured it which...

These steps are now part of Spreewald. Since Capybara 0.4.1 a within scope will only look at the first element...

The step definition below allows you to write: Then I should see a link labeled "Foo" But I should not...

To test if you can connect to a host using password authentication and explicitly deny public key authentication:

Here is how to switch your Selenium to Chrome: Make sure you've got a recent version of chromedriver in...

If you stub a method or set expectations with should_receive these stubbed methods may also yield blocks. This is...

If you need Google Chrome to run in English, and your system locale is a non-English one, you have...