Episode 3 - Getting specs to pass, part 1

Title

Click on image above for a preview

Released: Aug 18, 2010, Running time: 37 min

In this episode:

We go over all of the specs that are failing due to the upgrade to Rails 3 and RSpec 2, making changes needed to get them to pass.

Tags: rails3, rspec2, factory_girl, will_paginate, upgrade

Add to cart$5.00
  • Share

We start out with 72/198 RSpec examples failing.

We cover the following things while fixing the specs:

  • Clean up some deprecation warnings. Rails 3 has deprecated a bunch of APIs and the deprecation warnings are cluttering the spec run output.
  • write_attribute in ActiveRecord is now a private method, so it can no longer be invoked like “self.write_attribute”.
  • View spec API changes in RSpec 2 (yes, we wrote view specs): rendering, assigns and helpers have all changed somewhat.
  • Issues with escaping in views: the new rails XSS protection is on by default in Rails 3 so we have to mark our strings as html_safe in a few places.
  • The have_tag matcher is no longer part of RSpec 2. Webrat’s have_selector should be used instead.
  • Library linkage problems with the libxml-ruby gem.

We run into some problems requires because we have not set up Bundler correctly, so we work around them for now. It won’t be until later that we figure out what we did wrong in setting up Bundler and fix it.

References:

Update: part 2 is out.

Screenshots

  • Vlcsnap-2010-08-18-12h36m24s153
  • Vlcsnap-2010-08-18-12h36m56s169
  • Vlcsnap-2010-08-18-12h38m14s149
  • Vlcsnap-2010-08-18-12h38m38s194
  • Vlcsnap-2010-08-18-12h39m21s130
  • Vlcsnap-2010-08-18-12h39m53s161

No comments yet

Commenting is disabled.