Pelargir

Musings on software and life from Matthew Bass.

July 15th, 2007

Explore chaotic agility at next month’s Agile RTP meetup

I’ll be speaking about chaotic agility at the Agile RTP meetup in August.

Chaotic agility is a phrase describing why I believe agility works: the science behind it models an amazingly accurate picture of a typical development project. Most of us will agree that agile teams produce better software on time and for less money. But few of us question why agility works. By better understanding the science behind agility, we will stop trying to manufacture and control software and instead allow it to emerge on its own.

Note that August’s meetup won’t be at Frankie’s. We’re trying out a new location at Misys Healthcare on Six Forks Road. Visit the meetup site for directions and a more detailed overview of the talk. See you there!

July 5th, 2007

Registration for BarCampRDU 2007 is open

Registration for this year’s BarCampRDU is now open. This is an event I unfortunately had to miss last year due to a prior commitment. I’m really looking forward to attending this year. It’s shaping up to be a fantastic experience.

July 4th, 2007

No need to check response when testing redirects

Early on in my exploration of Rails, I got into the habit of testing that the response code of an action indicated a redirect. It turns out that this check is entirely unnecessary since assert_redirected_to makes an identical check:

def assert_redirected_to(options = {}, message=nil)
  clean_backtrace do
    assert_response(:redirect, message)
    ...
  end
end

This is how one of my functional tests might have looked early on:

def test_index
  get :index
  assert_response :redirect
  assert_redirected_to :action => "list"
end

This is how the test should be written now:

def test_index
  get :index
  assert_redirected_to :action => "list"
end

I recall reading several examples that specifically checked for a :redirect response code before calling assert_redirected_to so it must have been necessary at some point. It’s certainly not necessary anymore. Keep this in mind and save yourself a line or two of code.