Test Your respond_to Block

Getting RESTful and wondering how to test your _respond_to_ block in your controller to make sure its returning the right format? Drop these into your _test_helper.rb_.
def assert_xml
  assert_match 'application/xml', @response.headers['Content-Type']
end

def assert_rss
  assert_match 'application/rss+xml', @response.headers['Content-Type']
end
Then in your functional tests, use them like this:
def test_return_xml
  get :index, :format => 'xml'
  assert_xml
end

def test_return_rss
  get :index, :format => 'rss'
  assert_rss
end
Yay!