Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

iFrame you frame…

George Dean
Tuesday, February 5, 2013

Helps

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
ActiveRecord::StatementInvalid:
  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.

Interestings

Homebrew is Kickstarting an automated test bot

http://www.kickstarter.com/projects/homebrew/brew-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 = Struct.new(:x, :y).new(session_name == :default ? 0 : width, 0)

Thanks to Ryan for the tip.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Add New Comment Cancel reply

Your email address will not be published.

George Dean

George Dean
San Francisco

Recent Posts

  • A Stately Resque
  • Test automation for iOS and smooth jazz
  • Beware RubyMine 5!
Subscribe to George's Feed

Author Topics

agile (4)
chef (1)
git (1)
github (1)
lobot (1)
resque (1)
ios (1)
nyancat (1)
rspec (1)
testing (1)
capybara (1)
homebrew (1)
mediaquery (1)
postgres (1)
sqllite (1)
mysql (1)
rubymine (1)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >