Archive for March, 2009

My calendar syncing setup

Posted in Workflow on March 27th, 2009 by chrismear – 3 Comments

I post this here so that future generations may laugh.

Diagram of calendar syncing setup, described below

I’ve used Apple’s iCal to manage my calendars for as long as I’ve had a Mac. In the past few months, since I started using two Macs and an iPhone on a regular basis, I’ve been using MobileMe to keep them in sync. This was all grand, except that I couldn’t sync my iCalendar subscriptions since MobileMe doesn’t support that yet.

More recently, I’ve needed to start keeping a separate work calendar to share with my colleagues at Greenvoice, who also share their calendars with me. We use Google Apps at Greenvoice for calendaring, but unfortunately, neither iCal nor MobileMe plays particularly well with Google Calendar.

Enter BusySync. This is a great piece of software that, among other clever syncing things, includes the ability to seamlessly sync your calendars from Google Calendar with calendars in iCal.

So. I have a personal Google Calendar account. I subscribe to iCalendar feeds in this account, and I also subscribe to my work calendars through it. Then, BusySync syncs all of these to iCal on my personal Mac. MobileMe then syncs this to my work Mac and my iPhone.

It’s kinda ridiculous, and took a fair amount of initial setup, but it now runs seamlessly.

Stricter routes speccing in RSpec 1.2.0

Posted in Rails on March 16th, 2009 by chrismear – Be the first to comment

I just updated the Greenvoice codebase to use Rails 2.3.2 and RSpec 1.2.0, and got a flurry of failing examples from our routing specs. It turns out the routes_for helper in RSpec 1.2.0 is a bit stricter when it comes to request methods and parameters.

For example, here’s an example that worked pre-1.2.0:

route_for(:controller => 'friends',
          :action => 'request_friend',
          :user_id => 1).should ==
'/users/1/friends/request_friend'

This fails under 1.2.0, for two reasons. First, if your route doesn’t accept GET requests, you need to specify the method like this:

route_for(:controller => 'friends',
          :action => 'request_friend',
          :user_id => 1).should ==
{
  :path => '/users/1/friends/request_friend',
  :method => :delete
}

Second, it’s stricter about all parameters being strings; in this example, the user_id parameter was specified as a number, and it wasn’t matching. This is the final, passing example:

route_for(:controller => 'friends',
          :action => 'request_friend',
          :user_id => '1').should ==
{
  :path => '/users/1/friends/request_friend',
  :method => :delete
}

Update: Of course, if I’d bothered to look, this is all pointed out in the ‘Upgrade’ document that comes with RSpec 1.2.0.