Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

iFrame you frame…


undefined method `fields' for nil

We keep getting this error across multiple projects & machines, with different versions of the pg gem and the PostgreSQL server, with varying consistency. Switching the tests to sqlite seems to fix it.

Failure/Error: Unable to find matching line from backtrace
  NoMethodError: undefined method `fields' for nil:NilClass: SELECT "locations".* FROM "locations"  WHERE "locations"."id" IN (11, 10, 5, 4, 1, 3, 2)

It appears that PG::Connection#async_exec is returning nil for some queries.

It was suggested to add a "fields" method for the nil class.


Homebrew is Kickstarting an automated test bot £50 to get a pair of pint glasses…

Resizing the window to test media queries

If you want to test your media query css as part of your acceptance suite, you can just ask Capybara to resize the firefox window.
Don't use the iframe to do this, because it will be buggy. Note you will need to use min/max-width not min/max-device-width when defining your media queries. Otherwise resizing the browser window will not trigger the media query.

Capybara.current_session.driver.browser.manage.window.resize_to(width, height)
Capybara.current_session.driver.browser.manage.window.position =, :y).new(session_name == :default ? 0 : width, 0)

Thanks to Ryan for the tip.

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *